7#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
47 char name [ 8 ] [ 8 ] ;
50 char letter [ 8 ] [ 1 ] ;
53 char command [ 128 ] ;
61 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL ,
"main", 0);
67 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table test ( name char ( 8 ) , amount int , letter char ( 1 ) )",
ECPGt_EOIT,
ECPGt_EORT);
81 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_exec_immediate,
"insert into test (name, \042amount\042, letter) values ('db: ''r1''', 1, 'f')",
ECPGt_EOIT,
ECPGt_EORT);
88 sprintf(command,
"insert into test (name, amount, letter) values ('db: ''r1''', 2, 't')");
96 sprintf(command,
"insert into test (name, amount, letter) select name, amount+10, letter from test");
101#line 35 "execute.pgc"
104 printf(
"Inserted %ld tuples via execute immediate\n",
sqlca.sqlerrd[2]);
106 sprintf(command,
"insert into test (name, amount, letter) select name, amount+$1, letter from test");
108#line 40 "execute.pgc"
111#line 40 "execute.pgc"
114 ECPGt_int,&(increment),(
long)1,(
long)1,
sizeof(
int),
116#line 41 "execute.pgc"
119#line 41 "execute.pgc"
122 printf(
"Inserted %ld tuples via prepared execute\n",
sqlca.sqlerrd[2]);
125#line 45 "execute.pgc"
128#line 45 "execute.pgc"
131 sprintf (command,
"select * from test");
134#line 49 "execute.pgc"
137#line 49 "execute.pgc"
140#line 50 "execute.pgc"
146#line 52 "execute.pgc"
149#line 52 "execute.pgc"
154 ECPGt_int,(amount),(
long)1,(
long)8,
sizeof(
int),
156 ECPGt_char,(letter),(
long)1,(
long)8,(1)*
sizeof(
char),
158#line 53 "execute.pgc"
161#line 53 "execute.pgc"
170#line 58 "execute.pgc"
171 char n [ 8 ] , l = letter [
i ] [ 0 ] ;
173#line 59 "execute.pgc"
174 int a = amount [
i ] ;
176#line 60 "execute.pgc"
179 strncpy(n,
name[
i], 8);
180 printf(
"name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n",
i, n,
i,
a,
i, l);
184#line 66 "execute.pgc"
187#line 66 "execute.pgc"
190#line 67 "execute.pgc"
193#line 67 "execute.pgc"
196 sprintf (command,
"select * from test where amount = $1");
199#line 71 "execute.pgc"
202#line 71 "execute.pgc"
205#line 72 "execute.pgc"
213#line 74 "execute.pgc"
216#line 74 "execute.pgc"
221 ECPGt_int,(amount),(
long)1,(
long)8,
sizeof(
int),
223 ECPGt_char,(letter),(
long)1,(
long)8,(1)*
sizeof(
char),
225#line 75 "execute.pgc"
228#line 75 "execute.pgc"
237#line 80 "execute.pgc"
238 char n [ 8 ] , l = letter [
i ] [ 0 ] ;
240#line 81 "execute.pgc"
241 int a = amount [
i ] ;
243#line 82 "execute.pgc"
246 strncpy(n,
name[
i], 8);
247 printf(
"name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n",
i, n,
i,
a,
i, l);
251#line 88 "execute.pgc"
254#line 88 "execute.pgc"
257#line 89 "execute.pgc"
260#line 89 "execute.pgc"
263 sprintf (command,
"select * from test where amount = $1");
266#line 93 "execute.pgc"
269#line 93 "execute.pgc"
276 ECPGt_int,(amount),(
long)1,(
long)8,
sizeof(
int),
278 ECPGt_char,(letter),(
long)1,(
long)8,(1)*
sizeof(
char),
280#line 94 "execute.pgc"
283#line 94 "execute.pgc"
292#line 99 "execute.pgc"
293 char n [ 8 ] , l = letter [
i ] [ 0 ] ;
295#line 100 "execute.pgc"
296 int a = amount [
i ] ;
298#line 101 "execute.pgc"
301 strncpy(n,
name[
i], 8);
302 printf(
"name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n",
i, n,
i,
a,
i, l);
306#line 107 "execute.pgc"
309#line 107 "execute.pgc"
312#line 108 "execute.pgc"
315#line 108 "execute.pgc"
318#line 109 "execute.pgc"
321#line 109 "execute.pgc"
324#line 110 "execute.pgc"
327#line 110 "execute.pgc"
bool ECPGdisconnect(int lineno, const char *connection_name)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)