summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/fcl-db/src/sqldb/examples/bcreatetable.pp
blob: cb47036eb3da6afa5fe34282a145c1393df4d87e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(******************************************************************************
 *                                                                            *
 *  (c) 2005 CNOC v.o.f.                                                      *
 *                                                                            *
 *  File:        bCreateTable.pp                                              *
 *  Author:      Joost van der Sluis (joost@cnoc.nl)                          *
 *  Description: SQLDB example and test program                               *
 *  License:     GPL                                                          *
 *                                                                            *
 ******************************************************************************)

program bCreateTable;

{$mode objfpc}{$H+}

uses
  Classes,
  sqldb,
  SqldbExampleUnit;

begin
  ReadIniFile;
  
  CreateFConnection;
  CreateFTransaction;

  Fconnection.Transaction := Ftransaction;
  
  Fconnection.ExecuteDirect('create table FPDEV (       ' +
                            '  id INT NOT NULL,           ' +
                            '  Name VARCHAR(50),          ' +
                            '  Email CHAR(50),            ' +
                            '  Birthdate Date,            ' +
                            '  PRIMARY KEY (id)           ' +
                            ')                            ');

  FTransaction.Commit;
  Ftransaction.Free;
  Fconnection.Free;
end.