you have to select it, like so...
select identity_val_local() as last_id from myschema.mytable
good luck
steve
On Wednesday, February 12, 2003, at 02:39 PM, Sameer Joshi wrote:
I am using the following code snippet to retrieve the Value inserted in the identity column of table(created as Generated always). I am firing this statement after firing the Insert statement.<image.tiff>
psSequence = connection.prepareStatement("values identity_val_local()");
rsSequence = psSequence.executeQuery();
if(rsSequence.next())
{
lSequence = rsSequence.getLong(1);
}
I am trying to run it on DB2 ver 7.1 on z/OS through the driver ibm.sql.DB2Driver.
I am getting the following error
SQl code -142 : The sql statement is not supported.
Pl help. I tried using s Statement instead of a Prepared Statement, but it does not work.
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
