bcreatetable.pp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. (******************************************************************************
  2. * *
  3. * (c) 2005 CNOC v.o.f. *
  4. * *
  5. * File: bCreateTable.pp *
  6. * Author: Joost van der Sluis ([email protected]) *
  7. * Description: SQLDB example and test program *
  8. * License: GPL *
  9. * *
  10. ******************************************************************************)
  11. program bCreateTable;
  12. {$mode objfpc}{$H+}
  13. uses
  14. Classes,
  15. sqldb, pqconnection, mysql4conn, IBConnection,
  16. SqldbExampleUnit;
  17. begin
  18. ReadIniFile;
  19. CreateFConnection;
  20. CreateFTransaction;
  21. Fconnection.Transaction := Ftransaction;
  22. Fconnection.ExecuteDirect('create table FPDEV ( ' +
  23. ' id INT NOT NULL, ' +
  24. ' Name VARCHAR(50), ' +
  25. ' Email CHAR(50), ' +
  26. ' Birthdate Date, ' +
  27. ' PRIMARY KEY (id) ' +
  28. '); ');
  29. FTransaction.Commit;
  30. Ftransaction.Free;
  31. Fconnection.Free;
  32. end.