7 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
9 #line 1 "prepareas.pgc"
15 #line 1 "regression.h"
22 #line 5 "prepareas.pgc"
25 #line 6 "prepareas.pgc"
34 #line 12 "prepareas.pgc"
35 int ivar1 = 0 , ivar2 = 0 ;
37 #line 13 "prepareas.pgc"
41 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
43 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
45 #line 15 "prepareas.pgc"
48 #line 15 "prepareas.pgc"
50 printf(
"%d %d\n", ivar1, ivar2);
59 #line 22 "prepareas.pgc"
60 int ivar1 = 1 , ivar2 = 2 ;
62 #line 23 "prepareas.pgc"
63 char v_include_dq_name [ 16 ] , v_include_ws_name [ 16 ] , v_normal_name [ 16 ] , v_query [ 64 ] ;
65 #line 24 "prepareas.pgc"
68 strcpy(v_normal_name,
"normal_name");
69 strcpy(v_include_dq_name,
"include_\"_name");
70 strcpy(v_include_ws_name,
"include_ _name");
71 strcpy(v_query,
"insert into test values(?,?)");
76 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
77 #line 34 "prepareas.pgc"
80 #line 34 "prepareas.pgc"
83 #line 35 "prepareas.pgc"
86 #line 35 "prepareas.pgc"
89 #line 36 "prepareas.pgc"
92 #line 36 "prepareas.pgc"
94 {
ECPGtrans(__LINE__, NULL,
"commit work");
95 #line 37 "prepareas.pgc"
98 #line 37 "prepareas.pgc"
101 #line 38 "prepareas.pgc"
104 #line 38 "prepareas.pgc"
111 #line 43 "prepareas.pgc"
114 #line 43 "prepareas.pgc"
116 printf(
"+++++ Test for prepnormal +++++\n");
117 printf(
"insert into test values(:ivar1,:ivar2)\n");
119 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
121 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
123 #line 46 "prepareas.pgc"
126 #line 46 "prepareas.pgc"
131 #line 49 "prepareas.pgc"
134 #line 49 "prepareas.pgc"
136 printf(
"+++++ Test for execute immediate +++++\n");
137 printf(
"execute immediate \"insert into test values(1,2)\"\n");
139 #line 52 "prepareas.pgc"
142 #line 52 "prepareas.pgc"
150 #line 58 "prepareas.pgc"
153 #line 58 "prepareas.pgc"
155 printf(
"+++++ Test for PREPARE ident FROM CString +++++\n");
156 printf(
"prepare ident_name from \"insert into test values(?,?)\"\n");
157 {
ECPGprepare(__LINE__, NULL, 0,
"ident_name",
"insert into test values(?,?)");
158 #line 61 "prepareas.pgc"
161 #line 61 "prepareas.pgc"
163 printf(
"execute ident_name using :ivar1,:ivar2\n");
165 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
167 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
169 #line 63 "prepareas.pgc"
172 #line 63 "prepareas.pgc"
177 #line 66 "prepareas.pgc"
180 #line 66 "prepareas.pgc"
182 printf(
"+++++ Test for PREPARE char_variable_normal_name FROM char_variable +++++\n");
183 printf(
"prepare :v_normal_name from :v_query\n");
184 {
ECPGprepare(__LINE__, NULL, 0, v_normal_name, v_query);
185 #line 69 "prepareas.pgc"
188 #line 69 "prepareas.pgc"
190 printf(
"execute :v_normal_name using :ivar1,:ivar2\n");
192 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
194 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
196 #line 71 "prepareas.pgc"
199 #line 71 "prepareas.pgc"
204 #line 74 "prepareas.pgc"
207 #line 74 "prepareas.pgc"
209 printf(
"+++++ Test for PREPARE char_variable_inc_dq_name FROM char_variable +++++\n");
210 printf(
"prepare :v_include_dq_name from :v_query\n");
211 {
ECPGprepare(__LINE__, NULL, 0, v_include_dq_name, v_query);
212 #line 77 "prepareas.pgc"
215 #line 77 "prepareas.pgc"
217 printf(
"execute :v_include_dq_name using :ivar1,:ivar2\n");
219 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
221 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
223 #line 79 "prepareas.pgc"
226 #line 79 "prepareas.pgc"
231 #line 82 "prepareas.pgc"
234 #line 82 "prepareas.pgc"
236 printf(
"+++++ Test for PREPARE char_variable_inc_ws_name FROM char_variable +++++\n");
237 printf(
"prepare :v_include_ws_name from :v_query\n");
238 {
ECPGprepare(__LINE__, NULL, 0, v_include_ws_name, v_query);
239 #line 85 "prepareas.pgc"
242 #line 85 "prepareas.pgc"
244 printf(
"execute :v_include_ws_name using :ivar1,:ivar2\n");
246 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
248 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
250 #line 87 "prepareas.pgc"
253 #line 87 "prepareas.pgc"
258 #line 90 "prepareas.pgc"
261 #line 90 "prepareas.pgc"
263 printf(
"+++++ Test for PREPARE CString_inc_ws_name FROM char_variable +++++\n");
264 printf(
"prepare \"include_ _name\" from :v_query\n");
265 {
ECPGprepare(__LINE__, NULL, 0,
"include_ _name", v_query);
266 #line 93 "prepareas.pgc"
269 #line 93 "prepareas.pgc"
271 printf(
"exec sql execute \"include_ _name\" using :ivar1,:ivar2\n");
273 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
275 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
277 #line 95 "prepareas.pgc"
280 #line 95 "prepareas.pgc"
285 #line 98 "prepareas.pgc"
288 #line 98 "prepareas.pgc"
290 printf(
"+++++ Test for PREPARE CString_normal_name FROM char_variable +++++\n");
291 printf(
"prepare \"norma_name\" from :v_query\n");
292 {
ECPGprepare(__LINE__, NULL, 0,
"normal_name", v_query);
293 #line 101 "prepareas.pgc"
296 #line 101 "prepareas.pgc"
298 printf(
"exec sql execute \"normal_name\" using :ivar1,:ivar2\n");
300 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
302 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
304 #line 103 "prepareas.pgc"
307 #line 103 "prepareas.pgc"
315 #line 109 "prepareas.pgc"
318 #line 109 "prepareas.pgc"
321 #line 110 "prepareas.pgc"
324 #line 110 "prepareas.pgc"
327 #line 111 "prepareas.pgc"
330 #line 111 "prepareas.pgc"
334 #line 113 "prepareas.pgc"
337 #line 113 "prepareas.pgc"
339 printf(
"+++++ Test for PREPARE ident(typelist) AS +++++\n");
340 printf(
"prepare ident_name(int,int) as insert into test values($1,$2)\n");
341 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_prepare,
"prepare $0 ( int , int ) as insert into test values ( $1 , $2 )",
342 ECPGt_const,
"ident_name",(
long)10,(
long)1,strlen(
"ident_name"),
344 #line 116 "prepareas.pgc"
347 #line 116 "prepareas.pgc"
349 printf(
"execute ident_name(:ivar1,:ivar2)\n");
351 ECPGt_const,
"ident_name",(
long)10,(
long)1,strlen(
"ident_name"),
353 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
355 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
357 #line 118 "prepareas.pgc"
360 #line 118 "prepareas.pgc"
364 #line 120 "prepareas.pgc"
367 #line 120 "prepareas.pgc"
371 #line 122 "prepareas.pgc"
374 #line 122 "prepareas.pgc"
376 printf(
"+++++ Test for PREPARE CString_normal_name(typelist) AS +++++\n");
377 printf(
"prepare \"normal_name\"(int,int) as insert into test values($1,$2)\n");
378 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_prepare,
"prepare $0 ( int , int ) as insert into test values ( $1 , $2 )",
379 ECPGt_const,
"normal_name",(
long)11,(
long)1,strlen(
"normal_name"),
381 #line 125 "prepareas.pgc"
384 #line 125 "prepareas.pgc"
386 printf(
"execute \"normal_name\"(:ivar1,:ivar2)\n");
388 ECPGt_const,
"normal_name",(
long)11,(
long)1,strlen(
"normal_name"),
390 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
392 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
394 #line 127 "prepareas.pgc"
397 #line 127 "prepareas.pgc"
401 #line 129 "prepareas.pgc"
404 #line 129 "prepareas.pgc"
408 #line 131 "prepareas.pgc"
411 #line 131 "prepareas.pgc"
413 printf(
"+++++ Test for PREPARE CString_include_ws_name(typelist) AS +++++\n");
414 printf(
"prepare \"include_ _name\"(int,int) as insert into test values($1,$2)\n");
415 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_prepare,
"prepare $0 ( int , int ) as insert into test values ( $1 , $2 )",
416 ECPGt_const,
"include_ _name",(
long)14,(
long)1,strlen(
"include_ _name"),
418 #line 134 "prepareas.pgc"
421 #line 134 "prepareas.pgc"
423 printf(
"execute \"include_ _name\"(:ivar1,:ivar2)\n");
425 ECPGt_const,
"include_ _name",(
long)14,(
long)1,strlen(
"include_ _name"),
427 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
429 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
431 #line 136 "prepareas.pgc"
434 #line 136 "prepareas.pgc"
438 #line 138 "prepareas.pgc"
441 #line 138 "prepareas.pgc"
445 #line 140 "prepareas.pgc"
448 #line 140 "prepareas.pgc"
450 printf(
"+++++ Test for PREPARE char_variable_normal_name(typelist) AS +++++\n");
451 printf(
"prepare :v_normal_name(int,int) as insert into test values($1,$2)\n");
452 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_prepare,
"prepare $0 ( int , int ) as insert into test values ( $1 , $2 )",
453 ECPGt_char,(v_normal_name),(
long)16,(
long)1,(16)*
sizeof(
char),
455 #line 143 "prepareas.pgc"
458 #line 143 "prepareas.pgc"
460 printf(
"execute :v_normal_name(:ivar1,:ivar2)\n");
462 ECPGt_char,(v_normal_name),(
long)16,(
long)1,(16)*
sizeof(
char),
464 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
466 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
468 #line 145 "prepareas.pgc"
471 #line 145 "prepareas.pgc"
475 #line 147 "prepareas.pgc"
478 #line 147 "prepareas.pgc"
482 #line 149 "prepareas.pgc"
485 #line 149 "prepareas.pgc"
487 printf(
"+++++ Test for PREPARE char_variable_include_ws_name(typelist) AS +++++\n");
488 printf(
"prepare :v_include_ws_name(int,int) as insert into test values($1,$2)\n");
489 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_prepare,
"prepare $0 ( int , int ) as insert into test values ( $1 , $2 )",
490 ECPGt_char,(v_include_ws_name),(
long)16,(
long)1,(16)*
sizeof(
char),
492 #line 152 "prepareas.pgc"
495 #line 152 "prepareas.pgc"
497 printf(
"execute :v_include_ws_name(:ivar1,:ivar2)\n");
499 ECPGt_char,(v_include_ws_name),(
long)16,(
long)1,(16)*
sizeof(
char),
501 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
503 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
505 #line 154 "prepareas.pgc"
508 #line 154 "prepareas.pgc"
512 #line 156 "prepareas.pgc"
515 #line 156 "prepareas.pgc"
519 #line 158 "prepareas.pgc"
522 #line 158 "prepareas.pgc"
524 printf(
"+++++ Test for EXECUTE :v_normal_name(const,const) +++++\n");
525 printf(
"prepare :v_normal_name from :v_query\n");
526 {
ECPGprepare(__LINE__, NULL, 0, v_normal_name, v_query);
527 #line 161 "prepareas.pgc"
530 #line 161 "prepareas.pgc"
532 printf(
"execute :v_normal_name(1,2)\n");
534 ECPGt_char,(v_normal_name),(
long)16,(
long)1,(16)*
sizeof(
char),
536 #line 163 "prepareas.pgc"
539 #line 163 "prepareas.pgc"
543 #line 165 "prepareas.pgc"
546 #line 165 "prepareas.pgc"
550 #line 167 "prepareas.pgc"
553 #line 167 "prepareas.pgc"
555 printf(
"+++++ Test for EXECUTE :v_normal_name(expr,expr) +++++\n");
556 printf(
"prepare :v_normal_name from :v_query\n");
557 {
ECPGprepare(__LINE__, NULL, 0, v_normal_name, v_query);
558 #line 170 "prepareas.pgc"
561 #line 170 "prepareas.pgc"
563 printf(
"execute :v_normal_name(0+1,1+1)\n");
565 ECPGt_char,(v_normal_name),(
long)16,(
long)1,(16)*
sizeof(
char),
567 #line 172 "prepareas.pgc"
570 #line 172 "prepareas.pgc"
574 #line 174 "prepareas.pgc"
577 #line 174 "prepareas.pgc"
581 #line 176 "prepareas.pgc"
584 #line 176 "prepareas.pgc"
586 printf(
"+++++ Test for combination PREPARE FROM and EXECUTE ident(typelist) +++++\n");
587 printf(
"prepare ident_name from :v_query\n");
588 {
ECPGprepare(__LINE__, NULL, 0,
"ident_name", v_query);
589 #line 179 "prepareas.pgc"
592 #line 179 "prepareas.pgc"
594 printf(
"execute ident_name(:ivar1,:ivar2)\n");
596 ECPGt_const,
"ident_name",(
long)10,(
long)1,strlen(
"ident_name"),
598 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
600 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
602 #line 181 "prepareas.pgc"
605 #line 181 "prepareas.pgc"
609 #line 183 "prepareas.pgc"
612 #line 183 "prepareas.pgc"
616 #line 185 "prepareas.pgc"
619 #line 185 "prepareas.pgc"
621 printf(
"+++++ Test for combination PREPARE FROM and EXECUTE CString_include_ws_name(typelist) +++++\n");
622 printf(
"prepare \"include_ _name\" from :v_query\n");
623 {
ECPGprepare(__LINE__, NULL, 0,
"include_ _name", v_query);
624 #line 188 "prepareas.pgc"
627 #line 188 "prepareas.pgc"
629 printf(
"execute \"include_ _name\"(:ivar1,:ivar2)\n");
631 ECPGt_const,
"include_ _name",(
long)14,(
long)1,strlen(
"include_ _name"),
633 ECPGt_int,&(ivar1),(
long)1,(
long)1,
sizeof(
int),
635 ECPGt_int,&(ivar2),(
long)1,(
long)1,
sizeof(
int),
637 #line 190 "prepareas.pgc"
640 #line 190 "prepareas.pgc"
644 #line 192 "prepareas.pgc"
647 #line 192 "prepareas.pgc"
651 #line 194 "prepareas.pgc"
654 #line 194 "prepareas.pgc"
656 {
ECPGtrans(__LINE__, NULL,
"commit work");
657 #line 195 "prepareas.pgc"
660 #line 195 "prepareas.pgc"
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
@ ECPGst_exec_with_exprlist
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)
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
static void check_result_of_insert(void)