× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Please read the following:

How to determine the value used by an identity column
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/db2/rbafzmst02.htm#ToC_402

How to determine the value used by a row id:
????


Some sample code:
     C/EXEC SQL
     C+ INSERT INTO OrdHead
     C+ (SHIPPED_TO,
     C+  ORDER_DATE)
     C+ VALUES(
     C+ 'ME',
     C+ '2003-10-25'
     C+       )
     C/END-EXEC

     C/EXEC SQL
     C+ VALUES Identity_Val_Local() into :NewOrder
     C/END-EXEC

     C/EXEC SQL
     C+ INSERT INTO OrdLine
     C+ (ORDERNO,
     C+  ORDERLINE,
     C+  ITEMNBR,
     C+  ITEMQTY)
     C+ VALUES(
     C+  Identity_Val_Local(),
     C+  1,
     C+  'a',
     C+  2)
     C/END-EXEC

     C/EXEC SQL
     C+ INSERT INTO OrdLine
     C+ (ORDERNO,
     C+  ORDERLINE,
     C+  ITEMNBR,
     C+  ITEMQTY)
     C+ VALUES(
     C+  :NewOrder,
     C+  2,
     C+  'B',
     C+  7)
     C/END-EXEC

      /free
       dsply NewOrder;
       *inlr=*on;
       return;
      /end-free

Rob Berendt
-- 
"They that can give up essential liberty to obtain a little temporary 
safety deserve neither liberty nor safety." 
Benjamin Franklin 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.