@@ -254,23 +254,78 @@ if (sqlca.sqlcode < 0) sqlprint();}
254
254
if (sqlca .sqlcode < 0 ) sqlprint ();}
255
255
#line 88 "execute.pgc"
256
256
257
- { ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "drop table test " , ECPGt_EOIT , ECPGt_EORT );
257
+ { ECPGdeallocate (__LINE__ , 0 , NULL , "f" );
258
258
#line 89 "execute.pgc"
259
259
260
260
if (sqlca .sqlcode < 0 ) sqlprint ();}
261
261
#line 89 "execute.pgc"
262
262
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
+
263
318
{ ECPGtrans (__LINE__ , NULL , "commit" );
264
- #line 90 "execute.pgc"
319
+ #line 109 "execute.pgc"
265
320
266
321
if (sqlca .sqlcode < 0 ) sqlprint ();}
267
- #line 90 "execute.pgc"
322
+ #line 109 "execute.pgc"
268
323
269
324
{ ECPGdisconnect (__LINE__ , "CURRENT" );
270
- #line 91 "execute.pgc"
325
+ #line 110 "execute.pgc"
271
326
272
327
if (sqlca .sqlcode < 0 ) sqlprint ();}
273
- #line 91 "execute.pgc"
328
+ #line 110 "execute.pgc"
274
329
275
330
276
331
return (0 );
0 commit comments