1
/* Processed by ecpg (regression mode) */
2
/* These include files are added by the preprocessor */
6
/* End of automatic include section */
7
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
16
#line 1 "regression.h"
26
/* exec sql whenever sqlerror sqlprint ; */
33
/* exec sql type intarray is int [ 6 ] */
36
typedef int intarray[ 6];
41
/* exec sql begin declare section */
43
typedef char string [ 8 ];
55
char name [ 6 ] [ 8 ] ;
58
char letter [ 6 ] [ 1 ] ;
66
/* exec sql end declare section */
73
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , NULL, 0);
76
if (sqlca.sqlcode < 0) sqlprint();}
80
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test ( name char ( 8 ) , amount int , letter char ( 1 ) )", ECPGt_EOIT, ECPGt_EORT);
83
if (sqlca.sqlcode < 0) sqlprint();}
86
{ ECPGtrans(__LINE__, NULL, "commit");
89
if (sqlca.sqlcode < 0) sqlprint();}
93
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into Test ( name , amount , letter ) values ( 'false' , 1 , 'f' )", ECPGt_EOIT, ECPGt_EORT);
96
if (sqlca.sqlcode < 0) sqlprint();}
99
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test ( name , amount , letter ) values ( 'true' , 2 , 't' )", ECPGt_EOIT, ECPGt_EORT);
100
#line 40 "define.pgc"
102
if (sqlca.sqlcode < 0) sqlprint();}
103
#line 40 "define.pgc"
105
{ ECPGtrans(__LINE__, NULL, "commit");
106
#line 41 "define.pgc"
108
if (sqlca.sqlcode < 0) sqlprint();}
109
#line 41 "define.pgc"
112
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select * from test", ECPGt_EOIT,
113
ECPGt_char,(name),(long)8,(long)6,(8)*sizeof(char),
114
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
115
ECPGt_int,(amount),(long)1,(long)6,sizeof(int),
116
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
117
ECPGt_char,(letter),(long)1,(long)6,(1)*sizeof(char),
118
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
119
#line 43 "define.pgc"
121
if (sqlca.sqlcode < 0) sqlprint();}
122
#line 43 "define.pgc"
125
for (i=0, j=sqlca.sqlerrd[2]; i<j; i++)
127
/* exec sql begin declare section */
131
#line 48 "define.pgc"
132
char n [ 8 ] , l = letter [ i ] [ 0 ] ;
134
#line 49 "define.pgc"
135
int a = amount [ i ] ;
136
/* exec sql end declare section */
137
#line 50 "define.pgc"
140
strncpy(n, name[i], 8);
141
printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, n, i, a, i, l);
144
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table test", ECPGt_EOIT, ECPGt_EORT);
145
#line 56 "define.pgc"
147
if (sqlca.sqlcode < 0) sqlprint();}
148
#line 56 "define.pgc"
150
{ ECPGtrans(__LINE__, NULL, "commit");
151
#line 57 "define.pgc"
153
if (sqlca.sqlcode < 0) sqlprint();}
154
#line 57 "define.pgc"
156
{ ECPGdisconnect(__LINE__, "CURRENT");
157
#line 58 "define.pgc"
159
if (sqlca.sqlcode < 0) sqlprint();}
160
#line 58 "define.pgc"