> Ok, searching some more I see that "select scope_identity()" could > return the generated primary key. But how to get the value?
Better use the RETURNING* clause** as it clearly state the column value you are expecting; The "scope_identity()" may be a source of subtle bugs that are difficult to resolve, for example : what if the table make use of two sequences (yes sometime this is needed) what if the table's insert trigger generates a insert query(or stored procedure) into another table which make use of sequence (*) http://www.postgresql.org/docs/8.3/interactive/sql-insert.html (**) this clause is at least supported by Firebird, MS SQL SERVER, ORACLE -- Inoussa O. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal