|
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/db2/rbafzmstscale.htm#scaidentity CREATE TABLE EMPLOYEE (EMPNO INTEGER GENERATED ALWAYS AS IDENTITY, NAME CHAR(30), SALARY DECIMAL(5,2), DEPT SMALLINT) INSERT INTO EMPLOYEE (NAME, SALARY, DEPT) // Who is going to report the typo to IBM? They put DEPTNO in the manual. VALUES('Rupert', 989.99, 50) VALUES IDENTITY_VAL_LOCAL() INTO :IVAR Now, maybe this is your question; I tried this simple program and I am having a tough time. Femployeex UF A E DISK rename(employeex:employeer) /include routines/qrpglesrc,psds /free name='test'; salary=1; dept=5; write employeer; *inlr=*on; /end-free None of my current fields in the psds show it. Anyone have a suggestion? However, this program works fine, and shows the right value: Femployeex UF A E DISK rename(employeex:employeer) D ivar s 10i 0 /free name='test'; salary=1; dept=5; write employeer; *inlr=*on; exec sql VALUES IDENTITY_VAL_LOCAL() INTO :IVAR; dsply ivar; /end-free Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
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.