UniDAC

TCustomUniDataSet.LastInsertId Property

Can be used with MySQL and PostgreSQL servers to get the value of the ID field after executing INSERT statement.

Class

TCustomUniDataSet

Syntax

property LastInsertId: int64;

Remarks

The LastInsertId property can be used with MySQL and PostgreSQL servers to get the value of the ID field after executing INSERT statement.

For MySQL LastInsertId returns the ID generated for an AUTO_INCREMENT column by the previous query. Use this property after you have performed an INSERT query into a table that contains an AUTO_INCREMENT field.

For PostgreSQL LastInsertId returns the OID value generated for an OID column in a table with OIDs by the previous query.

If the query does not perform insertion into a table that contains field of the types specified above, the value of LastInsertId won't be defined.

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback