ingo schuster wrote:
> No, the last SQL would return the whole list of course. That's probably a
> general problem with auto-increment fields: If you don't set the key
> explicitly and it is the only key of the table, how can you tell what the
> key is???
> Do you know how other databases handle this? I'll have a look if the DB2
> doc says anything about it.

MySQL has a special function called LAST_INSERT_ID() that returns the
value of the auto increment filed created by the most recent INSERT
statement execuded on the current connection.

SELECT LAST_INSERT_ID()

A good reason not to share JDBC Connection object among multiple
threads :-).

Rafal

--
Rafal Krzewski
Senior Internet Developer
mailto:[EMAIL PROTECTED]
+48 22 8534830 http://e-point.pl


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to