By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

How to get generated key back in php/db2 v8.1.9 Linux

P: n/a
I am doing an insert into a table with a generated key. How do I obtain
the generated key of the record I just inserted?
Mar 22 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Try

select gen_key from final table(insert into your_table (columns) values
(values))

That is, select the generated key as part of the insert statement.

I really, really like that feature.

-Chris

Mar 22 '06 #2

P: n/a
Chris wrote:
Try

select gen_key from final table(insert into your_table (columns) values
(values))

That is, select the generated key as part of the insert statement.

I really, really like that feature.

-Chris

Thank you very much. No doubt it is implied by the fine manuals, but I
sure didn't find it in the *[Ii]dent* samples in the samples directory.
Mar 23 '06 #3

P: n/a
The manuals aren't perfect either. IMNSHO, you need to know what you
are looking for.

Although, one thing about is really nice. It lists possible error codes
when using bad parameters.

B.

Mar 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.