posted 22 years ago
I am trying to insert data into 2 tables, but in order to insert into the 2nd table, I need a value from the record inserted into the 1st table, which was not provided by me in my code (it's the primary key of the table, and it's value is determined by the DB, not me)
So, I want to do this:
"insert into users (name, pwd) values (name, password)"
(which isn't a problem), but then I want to retrieve the user_id from the row I just inserted. As far as I know, once I execute an "insert" statement, the ResultSet only contains and int with the number of rows updated, not the actual contents of the table as with a "select."
Is there a way to retrieve this from the ResultSet of the 1st query?
[ July 16, 2002: Message edited by: Brian Kott ]
[ July 16, 2002: Message edited by: Brian Kott ]