[fpc-pascal] How to insert a record and get the primary key with sqldb?

Marco van de Voort marcov at stack.nl
Sat Oct 22 15:21:40 CEST 2011

In our previous episode, Felipe Monteiro de Carvalho said:
> Ok, now I want to insert a record in my table and I would like to
> obtain the auto-generated PrimaryKey

This is a classic problem, since SQL simply doesn't support this.

So all DBs do something else, for postgresql there are sequence objects that
can be queried, while other allow to return the id of the autogenerated

Afaik sqldb does not abstract this yet.

More information about the fpc-pascal mailing list