Why would you need to know this?

If you insert a row you can retrieve the value of the identity column just
generated by:
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/sqlp/rbafysfins.htm?lang=en-us
CREATE TABLE EMPSAMP
(EMPNO INTEGER GENERATED ALWAYS AS IDENTITY,
NAME CHAR(30),
SALARY DECIMAL(10,2),
DEPTNO SMALLINT,
LEVEL CHAR(30),
HIRETYPE VARCHAR(30) NOT NULL DEFAULT 'New Employee',
HIREDATE DATE NOT NULL WITH DEFAULT)

SELECT EMPNO, HIRETYPE, HIREDATE
FROM FINAL TABLE ( INSERT INTO EMPSAMP (NAME, SALARY, DEPTNO, LEVEL)
VALUES('Mary Smith', 35000.00, 11,
'Associate'))

Which is quite useful if you have an order header table with an identity
column and you want to use the new identity column on a related order line
table.

IDK if researching this will help: Identity Column Information
(Qdb_Qddfidcl)
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/apis/qdbrtvfd.htm?lang=en-us

Maybe searching for
Retrieve Database File Description (QDBRTVFD) API
might help. IDK if anyone has a sample using the offset for Identity
Column Information.

If this IS what you are looking for you can always request that IBM modify
one of the myriad DB2 catalogs to add this for you
Qddf_Id_ Curr_Start_With = Current START WITH value.
These catalogs sure beat the snot out of looking through all these API's.


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.