home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Shareware / Programare / pgedri / Source / Demos / Sequences / Readme.txt < prev    next >
Encoding:
Text File  |  2005-04-01  |  1.4 KB  |  41 lines

  1. pgExpress Driver Sequences Demo
  2. Vita Voom Software
  3. -----------------------------------------------------------------------
  4. This demo demostrates how to use a PostgreSQL sequence (created with .
  5. "CREATE SEQUENCE" statements or a serial column type) with pgExpress.
  6.  
  7. In basic steps, to support server-generated values, we have:
  8.  
  9. 1) 4 Components that make the connection to the to the table: a 
  10. TSQLConnection, a TSQLDataset, a TDatasetProvider and a 
  11. TClientDataset.
  12.  
  13. 2) Include the poPropagateChanges setting in The 
  14. TDatasetProvider.Options. This will make the changes made in the 
  15. DeltaDS propagate to the actual source dataset, making the changes 
  16. visible in the Grid.
  17.  
  18. 3) Include pfInKey in the primary key field ProviderFlags
  19.  
  20. 4) Handle the Provider's BeforeUpdateRecord event so that we 
  21. increment the sequence ourselves, when it's an Insert event.
  22.  
  23. To run the demo:
  24.  
  25. 1) Press the "Create Table" button
  26. 2) Press the "Open Table" button
  27. 3) Fill some values. The column "id" iks meant to be left empty since
  28. the server will generate its values.
  29. 4) Press "Apply Updates" so that the values are applied back to the 
  30. server.
  31.  
  32. Note:
  33.    For Kylix/Delphi portability reasons, this demo Uses the CLX, not 
  34.    VCL. It might look "flickering" for VCL users. The code is similar, 
  35.    however.   
  36. -----------------------------------------------------------------------
  37. Steve Howe
  38. howe@vitavoom.com
  39. http://www.vitavoom.com
  40.  
  41.