40 #line 14 "oldexec.pgc"
43 #line 15 "oldexec.pgc"
46 #line 16 "oldexec.pgc"
47 char name [ 8 ] [ 8 ] ;
49 #line 17 "oldexec.pgc"
50 char letter [ 8 ] [ 1 ] ;
52 #line 18 "oldexec.pgc"
53 char command [ 128 ] ;
55 #line 19 "oldexec.pgc"
61 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL ,
"main", 0);
62 #line 24 "oldexec.pgc"
65 #line 24 "oldexec.pgc"
68 {
ECPGdo(__LINE__, 0, 1, NULL, 1,
ECPGst_normal,
"create table test ( name char ( 8 ) , amount int , letter char ( 1 ) )",
ECPGt_EOIT,
ECPGt_EORT);
69 #line 26 "oldexec.pgc"
72 #line 26 "oldexec.pgc"
75 #line 27 "oldexec.pgc"
78 #line 27 "oldexec.pgc"
81 sprintf(command,
"insert into test (name, amount, letter) values ('db: ''r1''', 1, 'f')");
83 #line 30 "oldexec.pgc"
86 #line 30 "oldexec.pgc"
89 sprintf(command,
"insert into test (name, amount, letter) values ('db: ''r1''', 2, 't')");
91 #line 33 "oldexec.pgc"
94 #line 33 "oldexec.pgc"
97 sprintf(command,
"insert into test (name, amount, letter) select name, amount+10, letter from test");
99 #line 36 "oldexec.pgc"
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)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno)