@@ -366,103 +366,71 @@ if (sqlca.sqlcode < 0) sqlprint();}
366
366
printResult ("testcase2" , 2 );
367
367
368
368
/*
369
- * testcase3. using DECLARE STATEMENT at con1 ,
370
- * using PREPARE and CURSOR statement at con2
369
+ * testcase3. using DECLARE STATEMENT without using AT clause ,
370
+ * using PREPARE and EXECUTE statement without using AT clause
371
371
*/
372
372
reset ();
373
373
374
374
/* declare \"stmt_3\" as an SQL identifier */
375
375
#line 122 "declare.pgc"
376
376
377
- { ECPGprepare (__LINE__ , "con1" , 0 , "stmt_3" , selectString );
377
+ { ECPGprepare (__LINE__ , NULL , 0 , "stmt_3" , selectString );
378
378
#line 123 "declare.pgc"
379
379
380
380
if (sqlca .sqlcode < 0 ) sqlprint ();}
381
381
#line 123 "declare.pgc"
382
382
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 ),
403
385
ECPGt_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 ),
405
387
ECPGt_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 ),
407
389
ECPGt_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"
412
391
413
392
if (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"
420
394
421
- if (sqlca .sqlcode < 0 ) sqlprint ();}
422
- #line 134 "declare.pgc"
423
395
424
- { ECPGdeallocate (__LINE__ , 0 , "con1" , "stmt_3" );
425
- #line 135 "declare.pgc"
396
+ { ECPGdeallocate (__LINE__ , 0 , NULL , "stmt_3" );
397
+ #line 126 "declare.pgc"
426
398
427
399
if (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"
432
401
433
402
434
403
printResult ("testcase3" , 2 );
435
404
436
-
437
405
/*
438
406
* testcase4. using DECLARE STATEMENT without using AT clause,
439
407
* using PREPARE and CURSOR statement at con2
440
408
*/
441
409
reset ();
442
410
443
411
/* declare \"stmt_4\" as an SQL identifier */
444
- #line 147 "declare.pgc"
412
+ #line 136 "declare.pgc"
445
413
446
414
{ ECPGprepare (__LINE__ , "con2" , 0 , "stmt_4" , selectString );
447
- #line 148 "declare.pgc"
415
+ #line 137 "declare.pgc"
448
416
449
417
if (sqlca .sqlcode < 0 ) sqlprint ();}
450
- #line 148 "declare.pgc"
418
+ #line 137 "declare.pgc"
451
419
452
420
/* declare cur_4 cursor for $1 */
453
- #line 149 "declare.pgc"
421
+ #line 138 "declare.pgc"
454
422
455
423
{ ECPGdo (__LINE__ , 0 , 1 , "con2" , 0 , ECPGst_normal , "declare cur_4 cursor for $1" ,
456
424
ECPGt_char_variable ,(ECPGprepared_statement ("con2" , "stmt_4" , __LINE__ )),(long )1 ,(long )1 ,(1 )* sizeof (char ),
457
425
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
458
- #line 150 "declare.pgc"
426
+ #line 139 "declare.pgc"
459
427
460
428
if (sqlca .sqlcode < 0 ) sqlprint ();}
461
- #line 150 "declare.pgc"
429
+ #line 139 "declare.pgc"
462
430
463
431
464
432
/* exec sql whenever not found break ; */
465
- #line 152 "declare.pgc"
433
+ #line 141 "declare.pgc"
466
434
467
435
i = 0 ;
468
436
while (1 )
@@ -474,173 +442,136 @@ if (sqlca.sqlcode < 0) sqlprint();}
474
442
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L ,
475
443
ECPGt_char ,(f3 [i ]),(long )20 ,(long )1 ,(20 )* sizeof (char ),
476
444
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
477
- #line 156 "declare.pgc"
445
+ #line 145 "declare.pgc"
478
446
479
447
if (sqlca .sqlcode == ECPG_NOT_FOUND ) break ;
480
- #line 156 "declare.pgc"
448
+ #line 145 "declare.pgc"
481
449
482
450
if (sqlca .sqlcode < 0 ) sqlprint ();}
483
- #line 156 "declare.pgc"
451
+ #line 145 "declare.pgc"
484
452
485
453
i ++ ;
486
454
}
487
455
{ 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"
489
457
490
458
if (sqlca .sqlcode < 0 ) sqlprint ();}
491
- #line 159 "declare.pgc"
459
+ #line 148 "declare.pgc"
492
460
493
461
{ ECPGdeallocate (__LINE__ , 0 , "con2" , "stmt_4" );
494
- #line 160 "declare.pgc"
462
+ #line 149 "declare.pgc"
495
463
496
464
if (sqlca .sqlcode < 0 ) sqlprint ();}
497
- #line 160 "declare.pgc"
465
+ #line 149 "declare.pgc"
498
466
499
467
/* exec sql whenever not found continue ; */
500
- #line 161 "declare.pgc"
468
+ #line 150 "declare.pgc"
501
469
502
470
503
471
printResult ("testcase4" , 2 );
504
472
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
-
542
473
/*
543
474
* DESCRIBE statement is also supported.
544
475
*/
545
476
/* declare \"stmt_desc\" as an SQL identifier */
546
- #line 182 "declare.pgc"
477
+ #line 157 "declare.pgc"
547
478
548
479
{ ECPGprepare (__LINE__ , "con1" , 0 , "stmt_desc" , selectString );
549
- #line 183 "declare.pgc"
480
+ #line 158 "declare.pgc"
550
481
551
482
if (sqlca .sqlcode < 0 ) sqlprint ();}
552
- #line 183 "declare.pgc"
483
+ #line 158 "declare.pgc"
553
484
554
485
/* declare cur_desc cursor for $1 */
555
- #line 184 "declare.pgc"
486
+ #line 159 "declare.pgc"
556
487
557
488
{ ECPGdo (__LINE__ , 0 , 1 , "con1" , 0 , ECPGst_normal , "declare cur_desc cursor for $1" ,
558
489
ECPGt_char_variable ,(ECPGprepared_statement ("con1" , "stmt_desc" , __LINE__ )),(long )1 ,(long )1 ,(1 )* sizeof (char ),
559
490
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
560
- #line 185 "declare.pgc"
491
+ #line 160 "declare.pgc"
561
492
562
493
if (sqlca .sqlcode < 0 ) sqlprint ();}
563
- #line 185 "declare.pgc"
494
+ #line 160 "declare.pgc"
564
495
565
496
566
497
/* descriptor can be used for describe statement */
567
498
ECPGallocate_desc (__LINE__ , "desc_for_describe" );
568
- #line 188 "declare.pgc"
499
+ #line 163 "declare.pgc"
569
500
570
501
if (sqlca .sqlcode < 0 ) sqlprint ();
571
- #line 188 "declare.pgc"
502
+ #line 163 "declare.pgc"
572
503
573
504
{ ECPGdescribe (__LINE__ , 0 , 0 , "con1" , "stmt_desc" ,
574
505
ECPGt_descriptor , "desc_for_describe" , 1L , 1L , 1L ,
575
506
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );}
576
- #line 189 "declare.pgc"
507
+ #line 164 "declare.pgc"
577
508
578
509
579
510
{ ECPGget_desc_header (__LINE__ , "desc_for_describe" , & (count ));
580
511
581
- #line 191 "declare.pgc"
512
+ #line 166 "declare.pgc"
582
513
583
514
if (sqlca .sqlcode < 0 ) sqlprint ();}
584
- #line 191 "declare.pgc"
515
+ #line 166 "declare.pgc"
585
516
586
517
{ ECPGget_desc (__LINE__ , "desc_for_describe" , 3 ,ECPGd_length ,
587
518
ECPGt_int ,& (length ),(long )1 ,(long )1 ,sizeof (int ), ECPGd_EODT );
588
519
589
- #line 192 "declare.pgc"
520
+ #line 167 "declare.pgc"
590
521
591
522
if (sqlca .sqlcode < 0 ) sqlprint ();}
592
- #line 192 "declare.pgc"
523
+ #line 167 "declare.pgc"
593
524
594
525
595
526
ECPGdeallocate_desc (__LINE__ , "desc_for_describe" );
596
- #line 194 "declare.pgc"
527
+ #line 169 "declare.pgc"
597
528
598
529
if (sqlca .sqlcode < 0 ) sqlprint ();
599
- #line 194 "declare.pgc"
530
+ #line 169 "declare.pgc"
600
531
601
532
602
533
/* for fetch statement */
603
534
ECPGallocate_desc (__LINE__ , "desc_for_fetch" );
604
- #line 197 "declare.pgc"
535
+ #line 172 "declare.pgc"
605
536
606
537
if (sqlca .sqlcode < 0 ) sqlprint ();
607
- #line 197 "declare.pgc"
538
+ #line 172 "declare.pgc"
608
539
609
540
{ ECPGdo (__LINE__ , 0 , 1 , "con1" , 0 , ECPGst_normal , "fetch cur_desc" , ECPGt_EOIT ,
610
541
ECPGt_descriptor , "desc_for_fetch" , 1L , 1L , 1L ,
611
542
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
612
- #line 198 "declare.pgc"
543
+ #line 173 "declare.pgc"
613
544
614
545
if (sqlca .sqlcode < 0 ) sqlprint ();}
615
- #line 198 "declare.pgc"
546
+ #line 173 "declare.pgc"
616
547
617
548
618
549
{ ECPGget_desc (__LINE__ , "desc_for_fetch" , 3 ,ECPGd_data ,
619
550
ECPGt_char ,(f3 [0 ]),(long )20 ,(long )1 ,(20 )* sizeof (char ), ECPGd_EODT );
620
551
621
- #line 200 "declare.pgc"
552
+ #line 175 "declare.pgc"
622
553
623
554
if (sqlca .sqlcode < 0 ) sqlprint ();}
624
- #line 200 "declare.pgc"
555
+ #line 175 "declare.pgc"
625
556
626
557
627
558
ECPGdeallocate_desc (__LINE__ , "desc_for_fetch" );
628
- #line 202 "declare.pgc"
559
+ #line 177 "declare.pgc"
629
560
630
561
if (sqlca .sqlcode < 0 ) sqlprint ();
631
- #line 202 "declare.pgc"
562
+ #line 177 "declare.pgc"
632
563
633
564
{ 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"
635
566
636
567
if (sqlca .sqlcode < 0 ) sqlprint ();}
637
- #line 203 "declare.pgc"
568
+ #line 178 "declare.pgc"
638
569
639
570
{ ECPGdeallocate (__LINE__ , 0 , "con1" , "stmt_desc" );
640
- #line 204 "declare.pgc"
571
+ #line 179 "declare.pgc"
641
572
642
573
if (sqlca .sqlcode < 0 ) sqlprint ();}
643
- #line 204 "declare.pgc"
574
+ #line 179 "declare.pgc"
644
575
645
576
646
577
printf ("****descriptor results****\n" );
@@ -650,16 +581,16 @@ if (sqlca.sqlcode < 0) sqlprint();}
650
581
void commitTable ()
651
582
{
652
583
{ ECPGtrans (__LINE__ , "con1" , "commit" );
653
- #line 212 "declare.pgc"
584
+ #line 187 "declare.pgc"
654
585
655
586
if (sqlca .sqlcode < 0 ) sqlprint ();}
656
- #line 212 "declare.pgc"
587
+ #line 187 "declare.pgc"
657
588
658
589
{ ECPGtrans (__LINE__ , "con2" , "commit" );
659
- #line 213 "declare.pgc"
590
+ #line 188 "declare.pgc"
660
591
661
592
if (sqlca .sqlcode < 0 ) sqlprint ();}
662
- #line 213 "declare.pgc"
593
+ #line 188 "declare.pgc"
663
594
664
595
}
665
596
0 commit comments