@@ -366,103 +366,71 @@ if (sqlca.sqlcode < 0) sqlprint();}
366366printResult ("testcase2" ,2 );
367367
368368/*
369- * testcase3. using DECLARE STATEMENTat con1 ,
370- * using PREPARE andCURSOR statementat con2
369+ * testcase3. using DECLARE STATEMENTwithout using AT clause ,
370+ * using PREPARE andEXECUTE statementwithout using AT clause
371371 */
372372reset ();
373373
374374/* declare \"stmt_3\" as an SQL identifier */
375375#line 122 "declare.pgc"
376376
377- {ECPGprepare (__LINE__ ,"con1" ,0 ,"stmt_3" ,selectString );
377+ {ECPGprepare (__LINE__ ,NULL ,0 ,"stmt_3" ,selectString );
378378#line 123 "declare.pgc"
379379
380380if (sqlca .sqlcode < 0 )sqlprint ();}
381381#line 123 "declare.pgc"
382382
383- /* declare cur_3 cursor for $1 */
384- #line 124 "declare.pgc"
385-
386- {ECPGdo (__LINE__ ,0 ,1 ,"con1" ,0 ,ECPGst_normal ,"declare cur_3 cursor for $1" ,
387- ECPGt_char_variable ,(ECPGprepared_statement ("con1" ,"stmt_3" ,__LINE__ )),(long )1 ,(long )1 ,(1 )* sizeof (char ),
388- ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EOIT ,ECPGt_EORT );
389- #line 125 "declare.pgc"
390-
391- if (sqlca .sqlcode < 0 )sqlprint ();}
392- #line 125 "declare.pgc"
393-
394-
395- /* exec sql whenever not found break ; */
396- #line 127 "declare.pgc"
397-
398- i = 0 ;
399- while (1 )
400- {
401- {ECPGdo (__LINE__ ,0 ,1 ,"con1" ,0 ,ECPGst_normal ,"fetch cur_3" ,ECPGt_EOIT ,
402- ECPGt_int ,& (f1 [i ]),(long )1 ,(long )1 ,sizeof (int ),
383+ {ECPGdo (__LINE__ ,0 ,1 ,NULL ,0 ,ECPGst_execute ,"stmt_3" ,ECPGt_EOIT ,
384+ ECPGt_int ,(f1 ),(long )1 ,(long )ARRAY_SIZE ,sizeof (int ),
403385ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,
404- ECPGt_int ,& (f2 [ i ] ),(long )1 ,(long )1 ,sizeof (int ),
386+ ECPGt_int ,(f2 ),(long )1 ,(long )ARRAY_SIZE ,sizeof (int ),
405387ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,
406- ECPGt_char ,(f3 [ i ] ),(long )20 ,(long )1 ,(20 )* sizeof (char ),
388+ ECPGt_char ,(f3 ),(long )20 ,(long )ARRAY_SIZE ,(20 )* sizeof (char ),
407389ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EORT );
408- #line 131 "declare.pgc"
409-
410- if (sqlca .sqlcode == ECPG_NOT_FOUND )break ;
411- #line 131 "declare.pgc"
390+ #line 124 "declare.pgc"
412391
413392if (sqlca .sqlcode < 0 )sqlprint ();}
414- #line 131 "declare.pgc"
415-
416- i ++ ;
417- }
418- {ECPGdo (__LINE__ ,0 ,1 ,"con1" ,0 ,ECPGst_normal ,"close cur_3" ,ECPGt_EOIT ,ECPGt_EORT );
419- #line 134 "declare.pgc"
393+ #line 124 "declare.pgc"
420394
421- if (sqlca .sqlcode < 0 )sqlprint ();}
422- #line 134 "declare.pgc"
423395
424- {ECPGdeallocate (__LINE__ ,0 ,"con1" ,"stmt_3" );
425- #line 135 "declare.pgc"
396+ {ECPGdeallocate (__LINE__ ,0 ,NULL ,"stmt_3" );
397+ #line 126 "declare.pgc"
426398
427399if (sqlca .sqlcode < 0 )sqlprint ();}
428- #line 135 "declare.pgc"
429-
430- /* exec sql whenever not found continue ; */
431- #line 136 "declare.pgc"
400+ #line 126 "declare.pgc"
432401
433402
434403printResult ("testcase3" ,2 );
435404
436-
437405/*
438406 * testcase4. using DECLARE STATEMENT without using AT clause,
439407 * using PREPARE and CURSOR statement at con2
440408 */
441409reset ();
442410
443411/* declare \"stmt_4\" as an SQL identifier */
444- #line 147 "declare.pgc"
412+ #line 136 "declare.pgc"
445413
446414 {ECPGprepare (__LINE__ ,"con2" ,0 ,"stmt_4" ,selectString );
447- #line 148 "declare.pgc"
415+ #line 137 "declare.pgc"
448416
449417if (sqlca .sqlcode < 0 )sqlprint ();}
450- #line 148 "declare.pgc"
418+ #line 137 "declare.pgc"
451419
452420/* declare cur_4 cursor for $1 */
453- #line 149 "declare.pgc"
421+ #line 138 "declare.pgc"
454422
455423 {ECPGdo (__LINE__ ,0 ,1 ,"con2" ,0 ,ECPGst_normal ,"declare cur_4 cursor for $1" ,
456424ECPGt_char_variable ,(ECPGprepared_statement ("con2" ,"stmt_4" ,__LINE__ )),(long )1 ,(long )1 ,(1 )* sizeof (char ),
457425ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EOIT ,ECPGt_EORT );
458- #line 150 "declare.pgc"
426+ #line 139 "declare.pgc"
459427
460428if (sqlca .sqlcode < 0 )sqlprint ();}
461- #line 150 "declare.pgc"
429+ #line 139 "declare.pgc"
462430
463431
464432/* exec sql whenever not found break ; */
465- #line 152 "declare.pgc"
433+ #line 141 "declare.pgc"
466434
467435i = 0 ;
468436while (1 )
@@ -474,173 +442,136 @@ if (sqlca.sqlcode < 0) sqlprint();}
474442ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,
475443ECPGt_char ,(f3 [i ]),(long )20 ,(long )1 ,(20 )* sizeof (char ),
476444ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EORT );
477- #line 156 "declare.pgc"
445+ #line 145 "declare.pgc"
478446
479447if (sqlca .sqlcode == ECPG_NOT_FOUND )break ;
480- #line 156 "declare.pgc"
448+ #line 145 "declare.pgc"
481449
482450if (sqlca .sqlcode < 0 )sqlprint ();}
483- #line 156 "declare.pgc"
451+ #line 145 "declare.pgc"
484452
485453i ++ ;
486454 }
487455 {ECPGdo (__LINE__ ,0 ,1 ,"con2" ,0 ,ECPGst_normal ,"close cur_4" ,ECPGt_EOIT ,ECPGt_EORT );
488- #line 159 "declare.pgc"
456+ #line 148 "declare.pgc"
489457
490458if (sqlca .sqlcode < 0 )sqlprint ();}
491- #line 159 "declare.pgc"
459+ #line 148 "declare.pgc"
492460
493461 {ECPGdeallocate (__LINE__ ,0 ,"con2" ,"stmt_4" );
494- #line 160 "declare.pgc"
462+ #line 149 "declare.pgc"
495463
496464if (sqlca .sqlcode < 0 )sqlprint ();}
497- #line 160 "declare.pgc"
465+ #line 149 "declare.pgc"
498466
499467/* exec sql whenever not found continue ; */
500- #line 161 "declare.pgc"
468+ #line 150 "declare.pgc"
501469
502470
503471printResult ("testcase4" ,2 );
504472
505- /*
506- * testcase5. using DECLARE STATEMENT without using AT clause,
507- * using PREPARE and EXECUTE statement without using AT clause
508- */
509- reset ();
510-
511- /* declare \"stmt_5\" as an SQL identifier */
512- #line 171 "declare.pgc"
513-
514- {ECPGprepare (__LINE__ ,NULL ,0 ,"stmt_5" ,selectString );
515- #line 172 "declare.pgc"
516-
517- if (sqlca .sqlcode < 0 )sqlprint ();}
518- #line 172 "declare.pgc"
519-
520- {ECPGdo (__LINE__ ,0 ,1 ,NULL ,0 ,ECPGst_execute ,"stmt_5" ,ECPGt_EOIT ,
521- ECPGt_int ,(f1 ),(long )1 ,(long )ARRAY_SIZE ,sizeof (int ),
522- ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,
523- ECPGt_int ,(f2 ),(long )1 ,(long )ARRAY_SIZE ,sizeof (int ),
524- ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,
525- ECPGt_char ,(f3 ),(long )20 ,(long )ARRAY_SIZE ,(20 )* sizeof (char ),
526- ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EORT );
527- #line 173 "declare.pgc"
528-
529- if (sqlca .sqlcode < 0 )sqlprint ();}
530- #line 173 "declare.pgc"
531-
532-
533- {ECPGdeallocate (__LINE__ ,0 ,NULL ,"stmt_5" );
534- #line 175 "declare.pgc"
535-
536- if (sqlca .sqlcode < 0 )sqlprint ();}
537- #line 175 "declare.pgc"
538-
539-
540- printResult ("testcase5" ,2 );
541-
542473/*
543474 * DESCRIBE statement is also supported.
544475 */
545476/* declare \"stmt_desc\" as an SQL identifier */
546- #line 182 "declare.pgc"
477+ #line 157 "declare.pgc"
547478
548479 {ECPGprepare (__LINE__ ,"con1" ,0 ,"stmt_desc" ,selectString );
549- #line 183 "declare.pgc"
480+ #line 158 "declare.pgc"
550481
551482if (sqlca .sqlcode < 0 )sqlprint ();}
552- #line 183 "declare.pgc"
483+ #line 158 "declare.pgc"
553484
554485/* declare cur_desc cursor for $1 */
555- #line 184 "declare.pgc"
486+ #line 159 "declare.pgc"
556487
557488 {ECPGdo (__LINE__ ,0 ,1 ,"con1" ,0 ,ECPGst_normal ,"declare cur_desc cursor for $1" ,
558489ECPGt_char_variable ,(ECPGprepared_statement ("con1" ,"stmt_desc" ,__LINE__ )),(long )1 ,(long )1 ,(1 )* sizeof (char ),
559490ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EOIT ,ECPGt_EORT );
560- #line 185 "declare.pgc"
491+ #line 160 "declare.pgc"
561492
562493if (sqlca .sqlcode < 0 )sqlprint ();}
563- #line 185 "declare.pgc"
494+ #line 160 "declare.pgc"
564495
565496
566497/* descriptor can be used for describe statement */
567498ECPGallocate_desc (__LINE__ ,"desc_for_describe" );
568- #line 188 "declare.pgc"
499+ #line 163 "declare.pgc"
569500
570501if (sqlca .sqlcode < 0 )sqlprint ();
571- #line 188 "declare.pgc"
502+ #line 163 "declare.pgc"
572503
573504 {ECPGdescribe (__LINE__ ,0 ,0 ,"con1" ,"stmt_desc" ,
574505ECPGt_descriptor ,"desc_for_describe" ,1L ,1L ,1L ,
575506ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EORT );}
576- #line 189 "declare.pgc"
507+ #line 164 "declare.pgc"
577508
578509
579510 {ECPGget_desc_header (__LINE__ ,"desc_for_describe" ,& (count ));
580511
581- #line 191 "declare.pgc"
512+ #line 166 "declare.pgc"
582513
583514if (sqlca .sqlcode < 0 )sqlprint ();}
584- #line 191 "declare.pgc"
515+ #line 166 "declare.pgc"
585516
586517 {ECPGget_desc (__LINE__ ,"desc_for_describe" ,3 ,ECPGd_length ,
587518ECPGt_int ,& (length ),(long )1 ,(long )1 ,sizeof (int ),ECPGd_EODT );
588519
589- #line 192 "declare.pgc"
520+ #line 167 "declare.pgc"
590521
591522if (sqlca .sqlcode < 0 )sqlprint ();}
592- #line 192 "declare.pgc"
523+ #line 167 "declare.pgc"
593524
594525
595526ECPGdeallocate_desc (__LINE__ ,"desc_for_describe" );
596- #line 194 "declare.pgc"
527+ #line 169 "declare.pgc"
597528
598529if (sqlca .sqlcode < 0 )sqlprint ();
599- #line 194 "declare.pgc"
530+ #line 169 "declare.pgc"
600531
601532
602533/* for fetch statement */
603534ECPGallocate_desc (__LINE__ ,"desc_for_fetch" );
604- #line 197 "declare.pgc"
535+ #line 172 "declare.pgc"
605536
606537if (sqlca .sqlcode < 0 )sqlprint ();
607- #line 197 "declare.pgc"
538+ #line 172 "declare.pgc"
608539
609540 {ECPGdo (__LINE__ ,0 ,1 ,"con1" ,0 ,ECPGst_normal ,"fetch cur_desc" ,ECPGt_EOIT ,
610541ECPGt_descriptor ,"desc_for_fetch" ,1L ,1L ,1L ,
611542ECPGt_NO_INDICATOR ,NULL ,0L ,0L ,0L ,ECPGt_EORT );
612- #line 198 "declare.pgc"
543+ #line 173 "declare.pgc"
613544
614545if (sqlca .sqlcode < 0 )sqlprint ();}
615- #line 198 "declare.pgc"
546+ #line 173 "declare.pgc"
616547
617548
618549 {ECPGget_desc (__LINE__ ,"desc_for_fetch" ,3 ,ECPGd_data ,
619550ECPGt_char ,(f3 [0 ]),(long )20 ,(long )1 ,(20 )* sizeof (char ),ECPGd_EODT );
620551
621- #line 200 "declare.pgc"
552+ #line 175 "declare.pgc"
622553
623554if (sqlca .sqlcode < 0 )sqlprint ();}
624- #line 200 "declare.pgc"
555+ #line 175 "declare.pgc"
625556
626557
627558ECPGdeallocate_desc (__LINE__ ,"desc_for_fetch" );
628- #line 202 "declare.pgc"
559+ #line 177 "declare.pgc"
629560
630561if (sqlca .sqlcode < 0 )sqlprint ();
631- #line 202 "declare.pgc"
562+ #line 177 "declare.pgc"
632563
633564 {ECPGdo (__LINE__ ,0 ,1 ,"con1" ,0 ,ECPGst_normal ,"close cur_desc" ,ECPGt_EOIT ,ECPGt_EORT );
634- #line 203 "declare.pgc"
565+ #line 178 "declare.pgc"
635566
636567if (sqlca .sqlcode < 0 )sqlprint ();}
637- #line 203 "declare.pgc"
568+ #line 178 "declare.pgc"
638569
639570 {ECPGdeallocate (__LINE__ ,0 ,"con1" ,"stmt_desc" );
640- #line 204 "declare.pgc"
571+ #line 179 "declare.pgc"
641572
642573if (sqlca .sqlcode < 0 )sqlprint ();}
643- #line 204 "declare.pgc"
574+ #line 179 "declare.pgc"
644575
645576
646577printf ("****descriptor results****\n" );
@@ -650,16 +581,16 @@ if (sqlca.sqlcode < 0) sqlprint();}
650581void commitTable ()
651582{
652583 {ECPGtrans (__LINE__ ,"con1" ,"commit" );
653- #line 212 "declare.pgc"
584+ #line 187 "declare.pgc"
654585
655586if (sqlca .sqlcode < 0 )sqlprint ();}
656- #line 212 "declare.pgc"
587+ #line 187 "declare.pgc"
657588
658589 {ECPGtrans (__LINE__ ,"con2" ,"commit" );
659- #line 213 "declare.pgc"
590+ #line 188 "declare.pgc"
660591
661592if (sqlca .sqlcode < 0 )sqlprint ();}
662- #line 213 "declare.pgc"
593+ #line 188 "declare.pgc"
663594
664595}
665596