Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. s1devwiz

    SQL to get auto-generated key from last insert statement

    SOLVED! Ok, got it working. The problem was that I had the ODBC setting AUTOCOMMIT set to 'on' (the default) so that is why I was getting NULL values. I did try the VALUE command without error but got NULL values also, so I stuck with the select statement since I wasn't that familiar with the...
  2. s1devwiz

    SQL to get auto-generated key from last insert statement

    Thanks for the replies. First of all, my tables are defined with key fields defined with BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1, NO CACHE). I will not be explicitly changing the indentity fields and want DB2 to generate values for me. That part I got. My problem is...
  3. s1devwiz

    SQL to get auto-generated key from last insert statement

    Maybe a little more clarification is needed. I need to save a record in a parent table and records in the child table. I need to retrieve the value of the auto generated key of the newly inserted parent record in order to perform inserts on the child table. What are some techniques in DB2 to...
  4. s1devwiz

    SQL to get auto-generated key from last insert statement

    Greetings, I am new to DB2 and am migrating an app from Oracle to DB2 UDB Workgroup 7.1. I am planning on using the GENERATED ALWAYS AS IDENTITY clause for my primary key field in each of my tables. (the Oracle app uses sequences) My question is, after I perform an INSERT on a table, what is...

Part and Inventory Search

Back
Top