pgExpress Driver Sequences Demo
Vita Voom Software
-----------------------------------------------------------------------
This demo demostrates how to use a PostgreSQL sequence (created with .
"CREATE SEQUENCE" statements or a serial column type) with pgExpress.

In basic steps, to support server-generated values, we have:

1) 4 Components that make the connection to the to the table: a 
TSQLConnection, a TSQLDataset, a TDatasetProvider and a 
TClientDataset.

2) Include the poPropagateChanges setting in The 
TDatasetProvider.Options. This will make the changes made in the 
DeltaDS propagate to the actual source dataset, making the changes 
visible in the Grid.

3) Include pfInKey in the primary key field ProviderFlags

4) Handle the Provider's BeforeUpdateRecord event so that we 
increment the sequence ourselves, when it's an Insert event.

To run the demo:

1) Press the "Create Table" button
2) Press the "Open Table" button
3) Fill some values. The column "id" iks meant to be left empty since
the server will generate its values.
4) Press "Apply Updates" so that the values are applied back to the 
server.

Note:
   For Kylix/Delphi portability reasons, this demo Uses the CLX, not 
   VCL. It might look "flickering" for VCL users. The code is similar, 
   however.   
-----------------------------------------------------------------------
Steve Howe
howe@vitavoom.com
http://www.vitavoom.com

