1#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4
5exec sql include ../regression;
6
7exec sql whenever sqlerror sqlprint;
8
9int main(void)
10{
11	char msg[128];
12
13	ECPGdebug(1, stderr);
14
15	strcpy(msg, "connect");
16	exec sql connect to REGRESSDB1;
17	exec sql set autocommit to off;
18
19	strcpy(msg, "create");
20	exec sql create table t1(c int);
21
22	strcpy(msg, "commit");
23	exec sql commit;
24
25	strcpy(msg, "begin");
26	exec sql begin;
27
28	strcpy(msg, "insert");
29	exec sql insert into t1 values(1);
30
31	strcpy(msg, "prepare transaction");
32	exec sql prepare transaction 'gxid';
33
34	strcpy(msg, "commit prepared");
35	exec sql commit prepared 'gxid';
36
37	strcpy(msg, "drop");
38	exec sql drop table t1;
39
40	strcpy(msg, "disconnect");
41	exec sql disconnect current;
42
43	return 0;
44}
45