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

Michael Van Canneyt michael at freepascal.org
Sat Oct 22 16:53:41 CEST 2011



On Sat, 22 Oct 2011, Martin Schreiber wrote:

> On Saturday 22 October 2011 16.20:13 Michael Van Canneyt wrote:
>>>
>>> Note that I did not invest this stuff ... I just copied from stuff to
>>> create other tables which were already in the project.
>>
>> You must get a value first, and pass it along to the insert statement.
>>
>> Auto-generation is not possible, since you don't have any link between
>> the sequence and your table. (normally, this is done in the trigger).
>>
> BTW, MSEgui has tsequencelink which fetches a sequence value and stores it in
> the field by posting a inserted record automatically. Works for Firebird and
> Postgres.

Indeed. IBX has a similar feature. One more for the TODO list.

Michael.



More information about the fpc-pascal mailing list