db2_last_insert_id

PECL ibm_db2 >= 1.7.1
db2_last_insert_id - Returns the auto generated ID of the last insert query that successfully executed on this connection
Manual
Code Examples

Example #1 A db2_last_insert_id example

Result: Last Insert ID is : 1
PHP Version: