DB2 SQL DB GENERATED SEQUENCE : IDENTITY COLUMN

Get last value generated for IDENTITY COLUMN

Use function “IDENTITY_VAL_LOCAL” to retrieve last value generated by SQL for IDENTITY COLUMN

SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1

the IDENTITY_VAL_LOCAL function does not return a null value after multi-row inserts.
It will return the last value that was generated

Leave a Reply

Your email address will not be published. Required fields are marked *