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);
68 {
ECPGdo(__LINE__, 0, 1, NULL, 1,
ECPGst_normal,
"create table test ( name char ( 8 ) , amount int , letter char ( 1 ) )",
ECPGt_EOIT,
ECPGt_EORT);
81 sprintf(command,
"insert into test (name, amount, letter) values ('db: ''r1''', 1, 'f')");
89 sprintf(command,
"insert into test (name, amount, letter) values ('db: ''r1''', 2, 't')");
97 sprintf(command,
"insert into test (name, amount, letter) select name, amount+10, letter from test");
102#line 36 "oldexec.pgc"
105 printf(
"Inserted %ld tuples via execute immediate\n",
sqlca.sqlerrd[2]);
107 sprintf(command,
"insert into test (name, amount, letter) select name, amount+$1, letter from test");
109#line 41 "oldexec.pgc"
112#line 41 "oldexec.pgc"
115 ECPGt_int,&(increment),(
long)1,(
long)1,
sizeof(
int),
117#line 42 "oldexec.pgc"
120#line 42 "oldexec.pgc"
123 printf(
"Inserted %ld tuples via prepared execute\n",
sqlca.sqlerrd[2]);
126#line 46 "oldexec.pgc"
129#line 46 "oldexec.pgc"
132 sprintf (command,
"select * from test");
135#line 50 "oldexec.pgc"
138#line 50 "oldexec.pgc"
141#line 51 "oldexec.pgc"
147#line 53 "oldexec.pgc"
150#line 53 "oldexec.pgc"
155 ECPGt_int,(amount),(
long)1,(
long)8,
sizeof(
int),
157 ECPGt_char,(letter),(
long)1,(
long)8,(1)*
sizeof(
char),
159#line 54 "oldexec.pgc"
162#line 54 "oldexec.pgc"
167 char n[8], l = letter[
i][0];
170 strncpy(n,
name[
i], 8);
171 printf(
"name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n",
i, n,
i,
a,
i, l);
175#line 65 "oldexec.pgc"
178#line 65 "oldexec.pgc"
181 sprintf (command,
"select * from test where ? = amount");
184#line 69 "oldexec.pgc"
187#line 69 "oldexec.pgc"
190#line 70 "oldexec.pgc"
198#line 72 "oldexec.pgc"
201#line 72 "oldexec.pgc"
206 ECPGt_int,(amount),(
long)1,(
long)8,
sizeof(
int),
208 ECPGt_char,(letter),(
long)1,(
long)8,(1)*
sizeof(
char),
210#line 73 "oldexec.pgc"
213#line 73 "oldexec.pgc"
218 char n[8], l = letter[
i][0];
221 strncpy(n,
name[
i], 8);
222 printf(
"name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n",
i, n,
i,
a,
i, l);
226#line 84 "oldexec.pgc"
229#line 84 "oldexec.pgc"
232#line 85 "oldexec.pgc"
235#line 85 "oldexec.pgc"
238#line 86 "oldexec.pgc"
241#line 86 "oldexec.pgc"
244#line 87 "oldexec.pgc"
247#line 87 "oldexec.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)