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

Help in using scalar function IDENTITY_VAL _LOCAL

P: 1
Dear colleagues,

I'm programming in ADS-OnLine Language attached to a DB2 V7R1 server which acts as a data repository.

I need to know how to use the scalar function IDENTITY_VAL_LOCAL in order to retrieve the last id value generated by DB2 for a identity column.

For example, if I use the function as follows

EXEC SQL
VALUES IDENTITY_VAL_LOCAL()
INTO :<variable_name>
END-EXEC.

the precompiler does not undestand it and return me a SQLCODE -104.

More, if I use like this :

EXEC SQL
SELECT IDENTITY_VAL_LOCAL()
FROM ?????????????
INTO :<variable_name>
END-EXEC.

I need to know what to put in the FROM clause

Can someone help me, please?

Kind regards
Feb 12 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.