|  |  | Archives of the TeradataForumMessage Posted: Mon, 25 Oct 2010 @ 22:17:39 GMT
 
 
  
| Subj: |  | Re: Retrieving Identity from Last Insert |  |  |  | From: |  | Michael Kappel |  
 I set the ODBC  Return Generated Keys  to  Identity Column .  My code calls SQLBindParamter and SQLExecute to do the insert, and then
SQLMoreResults and SQLFetch to retrieve the identity value.  All is good except when I want to reuse the statement.  I figured out that I need to
call SQLMoreResults after the fetch to drain out the results or it fails on the next SQLBindParamter with  Function Sequence Error .  However,
getting past that, after I call SQLBindParamter and SQLExecute on the second insert, SQLMoreResults returns a NO_DATA result.  How can I get
around not having to SQLPrepare the statement again? 
 Dr. Michael R. Kappel 
 
 |  |