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.

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

Reply via email to