[fpc-pascal] Re: How to insert a record and get the primary key with sqldb?
michael.vancanneyt at wisa.be
michael.vancanneyt at wisa.be
Sat Oct 22 15:35:16 CEST 2011
On Sat, 22 Oct 2011, Felipe Monteiro de Carvalho wrote:
> Hello,
>
> Ok, searching some more I see that "select scope_identity()" could
> return the generated primary key. But how to get the value?
>
> DBComm.PQConnection.ExecuteDirect(SQLText);
>
> The method above has no return value =(
Use a TSQLQuery with SQL "select scope_identity() as theid" and read field 0.
I repeat, do not use ExecuteDirect.
Michael.
More information about the fpc-pascal
mailing list