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