db2_last_insert_id Returns the auto generated ID of the last insert query that successfully executed on this connection &reftitle.description; intdb2_last_insert_id resourceresource Returns the auto generated ID of the last insert query that successfully executed on this connection. The result of this function is not affected by any of the following: A single row INSERT statement with a VALUES clause for a table without an identity column. A multiple row INSERT statement with a VALUES clause. An INSERT statement with a fullselect. A ROLLBACK TO SAVEPOINT statement. &reftitle.parameters; resource A valid connection resource as returned from db2_connect or db2_pconnect. The value of this parameter cannot be a statement resource or result set resource. &reftitle.returnvalues; Returns the auto generated ID of last insert query that successfully executed on this connection. &reftitle.examples; <function>A db2_last_insert_id</function> example The following example shows how to return the auto generated ID of last insert query that successfully executed on this connection. ]]> &example.outputs;