@@ -254,23 +254,78 @@ if (sqlca.sqlcode < 0) sqlprint();}
254254if (sqlca .sqlcode < 0 ) sqlprint ();}
255255#line 88 "execute.pgc"
256256
257- { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "drop table test " , ECPGt_EOIT , ECPGt_EORT );
257+ { ECPGdeallocate (__LINE__ , 0 , NULL , "f" );
258258#line 89 "execute.pgc"
259259
260260if (sqlca .sqlcode < 0 ) sqlprint ();}
261261#line 89 "execute.pgc"
262262
263+
264+ sprintf (command , "select * from test where amount = $1" );
265+
266+ { ECPGprepare (__LINE__ , NULL , 0 , "f" , command );
267+ #line 93 "execute.pgc"
268+
269+ if (sqlca .sqlcode < 0 ) sqlprint ();}
270+ #line 93 "execute.pgc"
271+
272+ { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , 1 , "f" ,
273+ ECPGt_const ,"2" ,(long )1 ,(long )1 ,strlen ("2" ),
274+ ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT ,
275+ ECPGt_char ,(name ),(long )8 ,(long )8 ,(8 )* sizeof (char ),
276+ ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
277+ ECPGt_int ,(amount ),(long )1 ,(long )8 ,sizeof (int ),
278+ ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
279+ ECPGt_char ,(letter ),(long )1 ,(long )8 ,(1 )* sizeof (char ),
280+ ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
281+ #line 94 "execute.pgc"
282+
283+ if (sqlca .sqlcode < 0 ) sqlprint ();}
284+ #line 94 "execute.pgc"
285+
286+
287+ for (i = 0 , j = sqlca .sqlerrd [2 ]; i < j ; i ++ )
288+ {
289+ /* exec sql begin declare section */
290+
291+
292+
293+ #line 99 "execute.pgc"
294+ char n [ 8 ] , l = letter [ i ] [ 0 ] ;
295+
296+ #line 100 "execute.pgc"
297+ int a = amount [ i ] ;
298+ /* exec sql end declare section */
299+ #line 101 "execute.pgc"
300+
301+
302+ strncpy (n , name [i ], 8 );
303+ printf ("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n" , i , n , i , a , i , l );
304+ }
305+
306+ { ECPGdeallocate (__LINE__ , 0 , NULL , "f" );
307+ #line 107 "execute.pgc"
308+
309+ if (sqlca .sqlcode < 0 ) sqlprint ();}
310+ #line 107 "execute.pgc"
311+
312+ { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "drop table test " , ECPGt_EOIT , ECPGt_EORT );
313+ #line 108 "execute.pgc"
314+
315+ if (sqlca .sqlcode < 0 ) sqlprint ();}
316+ #line 108 "execute.pgc"
317+
263318 { ECPGtrans (__LINE__ , NULL , "commit" );
264- #line 90 "execute.pgc"
319+ #line 109 "execute.pgc"
265320
266321if (sqlca .sqlcode < 0 ) sqlprint ();}
267- #line 90 "execute.pgc"
322+ #line 109 "execute.pgc"
268323
269324 { ECPGdisconnect (__LINE__ , "CURRENT" );
270- #line 91 "execute.pgc"
325+ #line 110 "execute.pgc"
271326
272327if (sqlca .sqlcode < 0 ) sqlprint ();}
273- #line 91 "execute.pgc"
328+ #line 110 "execute.pgc"
274329
275330
276331 return (0 );
0 commit comments