PostgreSQL and serial data type

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
rant801601
Posts: 18
Joined: Wed 25 Jan 2006 09:28

PostgreSQL and serial data type

Post by rant801601 » Mon 19 Jan 2009 14:42

Is it possible to use serial field and UniDAC will get value on client (DataSet) automatically like it does with MSSQL or I must have sequence in database and define KeySequence like with Oracle database in DataSet ?

rant801601
Posts: 18
Joined: Wed 25 Jan 2006 09:28

Post by rant801601 » Mon 19 Jan 2009 16:08

I found out I have to modify INSERT SQL (exclude serial field and add RETURNING field) and set Query Options.ReturnParams to True.

Is this proper use or should UniDAC do this automatic ?

Best Regards,
Radovan Antloga

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 20 Jan 2009 10:01

The current version of UniDAC does not support generating INSERT statements with RETURNING automatically.

So you should manually assign such statement to the SQLInsert property, or use the KeySequence property.

Post Reply