procedure for cached updates and serial field

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
doublehelix
Posts: 9
Joined: Mon 28 Dec 2009 23:42

procedure for cached updates and serial field

Post by doublehelix » Fri 28 May 2010 21:27

I've been attempting to create a cached update table with dev express, unfortunately their table requires a record key field in order to function properly. This is ok when first reading. However, because I am using a cached update, any new records cannot be accessed because they have no record number and dev express requires it before it will move to the record. I've solved this by creating a index value that decrements creating temporary indexes below 0 and assigning the value to the record key field when a new record is created. The problem is that I want to replace the negative numbers when an update is applied with the actual serial value from the database. How do I do this? I realize that it might possibly be in the on update record event, but I do not know how to implement this.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 31 May 2010 11:58

Hello

You should set the SequenceMode property to the smInsert value. In this case your key field will be filled by sequence on calling the Insert method and you can resolve your issue without any temporary indexes.

Post Reply