Hi!
In dynamic SQL I'm inserting a row to a table with an IDENTITY column.
How can I retrieve the generated identity value?
The statement "VALUES IDENTITY_VAL_LOCAL()" returns the following error
when I try to PREPARE it:
SQL0142N The SQL statement is not supported. SQLSTATE=42612
SQLSTATE 42612: The statement string is an SQL statement that is not
acceptable in the context in which it is presented.
Any ideas?
Thanks.
WhoReallyCares
Serge Rielau - 28 Jan 2005 11:45 GMT
> Hi!
>
[quoted text clipped - 11 lines]
>
> WhoReallyCares
VALUES returns a table. Depending on your interface you may need to open
a cursor. Some interfaces actuallt have a function to return identity.
Cheers
Serge

Signature
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab