MySQL Forums
Forum List  »  Connector/ODBC

MySQL ODBC Data Adapter and auto_increment
Posted by: Dennis Dingemanse
Date: December 15, 2004 06:38AM

While migrating from MS SQL DataAdapters to MySQL ODBC DataAdapters a problem arises with inserting a new record with auto-increment and retrieving the automatically incremented field.

With MS SQL DataAdapter this is done with two sequential query strings in only one data adapter whereas the auto-increment field is retrieved in a second query (separated bij semi-colon) and put back in the data adapter with '...@@<field>'.

MySQL ODBC DataAdapter does not except this; the query can not be parsed.

Tried to apply LAST_INSERT_ID() but without success while this simulated with the MySQL command line does get the expected results.

Is there a general one-place-fix-all solution or do I have to split the two queries into a separate INSERT INTO .. and a SELECT .. query?

Options: ReplyQuote


Subject
Written By
Posted
MySQL ODBC Data Adapter and auto_increment
December 15, 2004 06:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.