@@ -155,13 +155,8 @@ dump_sqlda(sqlda_t *sqlda)
155
155
printf ("name sqlda descriptor: '%s' value %ld\n" , sqlda -> sqlvar [i ].sqlname .data , * (long int * )sqlda -> sqlvar [i ].sqldata );
156
156
break ;
157
157
case ECPGt_long_long :
158
- printf (
159
- #ifdef _WIN32
160
- "name sqlda descriptor: '%s' value %I64d\n" ,
161
- #else
162
- "name sqlda descriptor: '%s' value %lld\n" ,
163
- #endif
164
- sqlda -> sqlvar [i ].sqlname .data , * (long long int * )sqlda -> sqlvar [i ].sqldata );
158
+ printf ("name sqlda descriptor: '%s' value %lld\n" ,
159
+ sqlda -> sqlvar [i ].sqlname .data , * (long long int * )sqlda -> sqlvar [i ].sqldata );
165
160
break ;
166
161
case ECPGt_double :
167
162
printf ("name sqlda descriptor: '%s' value %f\n" , sqlda -> sqlvar [i ].sqlname .data , * (double * )sqlda -> sqlvar [i ].sqldata );
@@ -188,19 +183,19 @@ main (void)
188
183
189
184
190
185
191
- #line 71 "sqlda.pgc"
186
+ #line 66 "sqlda.pgc"
192
187
char * stmt1 = "SELECT * FROM t1" ;
193
188
194
- #line 72 "sqlda.pgc"
189
+ #line 67 "sqlda.pgc"
195
190
char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ;
196
191
197
- #line 73 "sqlda.pgc"
192
+ #line 68 "sqlda.pgc"
198
193
int rec ;
199
194
200
- #line 74 "sqlda.pgc"
195
+ #line 69 "sqlda.pgc"
201
196
int id ;
202
197
/* exec sql end declare section */
203
- #line 75 "sqlda.pgc"
198
+ #line 70 "sqlda.pgc"
204
199
205
200
206
201
char msg [128 ];
@@ -209,42 +204,42 @@ main (void)
209
204
210
205
strcpy (msg , "connect" );
211
206
{ ECPGconnect (__LINE__ , 0 , "ecpg1_regression" , NULL , NULL , "regress1" , 0 );
212
- #line 82 "sqlda.pgc"
207
+ #line 77 "sqlda.pgc"
213
208
214
209
if (sqlca .sqlcode < 0 ) exit (1 );}
215
- #line 82 "sqlda.pgc"
210
+ #line 77 "sqlda.pgc"
216
211
217
212
218
213
strcpy (msg , "set" );
219
214
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "set datestyle to iso" , ECPGt_EOIT , ECPGt_EORT );
220
- #line 85 "sqlda.pgc"
215
+ #line 80 "sqlda.pgc"
221
216
222
217
if (sqlca .sqlcode < 0 ) exit (1 );}
223
- #line 85 "sqlda.pgc"
218
+ #line 80 "sqlda.pgc"
224
219
225
220
226
221
strcpy (msg , "create" );
227
222
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) , big bigint )" , ECPGt_EOIT , ECPGt_EORT );
228
- #line 95 "sqlda.pgc"
223
+ #line 90 "sqlda.pgc"
229
224
230
225
if (sqlca .sqlcode < 0 ) exit (1 );}
231
- #line 95 "sqlda.pgc"
226
+ #line 90 "sqlda.pgc"
232
227
233
228
234
229
strcpy (msg , "insert" );
235
230
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' , 1111111111111111111 ) , ( 2 , null , null , null , null , null ) , ( 3 , 'c' , 0.0 , 3 , 'c' , 3333333333333333333 ) , ( 4 , 'd' , 'NaN' , 4 , 'd' , 4444444444444444444 ) , ( 5 , 'e' , 0.001234 , 5 , 'e' , 5555555555555555555 )" , ECPGt_EOIT , ECPGt_EORT );
236
- #line 103 "sqlda.pgc"
231
+ #line 98 "sqlda.pgc"
237
232
238
233
if (sqlca .sqlcode < 0 ) exit (1 );}
239
- #line 103 "sqlda.pgc"
234
+ #line 98 "sqlda.pgc"
240
235
241
236
242
237
strcpy (msg , "commit" );
243
238
{ ECPGtrans (__LINE__ , NULL , "commit" );
244
- #line 106 "sqlda.pgc"
239
+ #line 101 "sqlda.pgc"
245
240
246
241
if (sqlca .sqlcode < 0 ) exit (1 );}
247
- #line 106 "sqlda.pgc"
242
+ #line 101 "sqlda.pgc"
248
243
249
244
250
245
/* SQLDA test for getting all records from a table */
@@ -253,29 +248,29 @@ if (sqlca.sqlcode < 0) exit (1);}
253
248
254
249
strcpy (msg , "prepare" );
255
250
{ ECPGprepare (__LINE__ , NULL , 0 , "st_id1" , stmt1 );
256
- #line 113 "sqlda.pgc"
251
+ #line 108 "sqlda.pgc"
257
252
258
253
if (sqlca .sqlcode < 0 ) exit (1 );}
259
- #line 113 "sqlda.pgc"
254
+ #line 108 "sqlda.pgc"
260
255
261
256
262
257
strcpy (msg , "declare" );
263
258
/* declare mycur1 cursor for $1 */
264
- #line 116 "sqlda.pgc"
259
+ #line 111 "sqlda.pgc"
265
260
266
261
267
262
strcpy (msg , "open" );
268
263
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "declare mycur1 cursor for $1" ,
269
264
ECPGt_char_variable ,(ECPGprepared_statement (NULL , "st_id1" , __LINE__ )),(long )1 ,(long )1 ,(1 )* sizeof (char ),
270
265
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
271
- #line 119 "sqlda.pgc"
266
+ #line 114 "sqlda.pgc"
272
267
273
268
if (sqlca .sqlcode < 0 ) exit (1 );}
274
- #line 119 "sqlda.pgc"
269
+ #line 114 "sqlda.pgc"
275
270
276
271
277
272
/* exec sql whenever not found break ; */
278
- #line 121 "sqlda.pgc"
273
+ #line 116 "sqlda.pgc"
279
274
280
275
281
276
rec = 0 ;
@@ -285,37 +280,37 @@ if (sqlca.sqlcode < 0) exit (1);}
285
280
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "fetch 1 from mycur1" , ECPGt_EOIT ,
286
281
ECPGt_sqlda , & outp_sqlda , 0L , 0L , 0L ,
287
282
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
288
- #line 127 "sqlda.pgc"
283
+ #line 122 "sqlda.pgc"
289
284
290
285
if (sqlca .sqlcode == ECPG_NOT_FOUND ) break ;
291
- #line 127 "sqlda.pgc"
286
+ #line 122 "sqlda.pgc"
292
287
293
288
if (sqlca .sqlcode < 0 ) exit (1 );}
294
- #line 127 "sqlda.pgc"
289
+ #line 122 "sqlda.pgc"
295
290
296
291
297
292
printf ("FETCH RECORD %d\n" , ++ rec );
298
293
dump_sqlda (outp_sqlda );
299
294
}
300
295
301
296
/* exec sql whenever not found continue ; */
302
- #line 133 "sqlda.pgc"
297
+ #line 128 "sqlda.pgc"
303
298
304
299
305
300
strcpy (msg , "close" );
306
301
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "close mycur1" , ECPGt_EOIT , ECPGt_EORT );
307
- #line 136 "sqlda.pgc"
302
+ #line 131 "sqlda.pgc"
308
303
309
304
if (sqlca .sqlcode < 0 ) exit (1 );}
310
- #line 136 "sqlda.pgc"
305
+ #line 131 "sqlda.pgc"
311
306
312
307
313
308
strcpy (msg , "deallocate" );
314
309
{ ECPGdeallocate (__LINE__ , 0 , NULL , "st_id1" );
315
- #line 139 "sqlda.pgc"
310
+ #line 134 "sqlda.pgc"
316
311
317
312
if (sqlca .sqlcode < 0 ) exit (1 );}
318
- #line 139 "sqlda.pgc"
313
+ #line 134 "sqlda.pgc"
319
314
320
315
321
316
free (outp_sqlda );
@@ -326,35 +321,35 @@ if (sqlca.sqlcode < 0) exit (1);}
326
321
327
322
strcpy (msg , "prepare" );
328
323
{ ECPGprepare (__LINE__ , NULL , 0 , "st_id2" , stmt1 );
329
- #line 148 "sqlda.pgc"
324
+ #line 143 "sqlda.pgc"
330
325
331
326
if (sqlca .sqlcode < 0 ) exit (1 );}
332
- #line 148 "sqlda.pgc"
327
+ #line 143 "sqlda.pgc"
333
328
334
329
335
330
strcpy (msg , "declare" );
336
331
/* declare mycur2 cursor for $1 */
337
- #line 151 "sqlda.pgc"
332
+ #line 146 "sqlda.pgc"
338
333
339
334
340
335
strcpy (msg , "open" );
341
336
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "declare mycur2 cursor for $1" ,
342
337
ECPGt_char_variable ,(ECPGprepared_statement (NULL , "st_id2" , __LINE__ )),(long )1 ,(long )1 ,(1 )* sizeof (char ),
343
338
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT , ECPGt_EORT );
344
- #line 154 "sqlda.pgc"
339
+ #line 149 "sqlda.pgc"
345
340
346
341
if (sqlca .sqlcode < 0 ) exit (1 );}
347
- #line 154 "sqlda.pgc"
342
+ #line 149 "sqlda.pgc"
348
343
349
344
350
345
strcpy (msg , "fetch" );
351
346
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "fetch all from mycur2" , ECPGt_EOIT ,
352
347
ECPGt_sqlda , & outp_sqlda , 0L , 0L , 0L ,
353
348
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
354
- #line 157 "sqlda.pgc"
349
+ #line 152 "sqlda.pgc"
355
350
356
351
if (sqlca .sqlcode < 0 ) exit (1 );}
357
- #line 157 "sqlda.pgc"
352
+ #line 152 "sqlda.pgc"
358
353
359
354
360
355
outp_sqlda1 = outp_sqlda ;
@@ -372,18 +367,18 @@ if (sqlca.sqlcode < 0) exit (1);}
372
367
373
368
strcpy (msg , "close" );
374
369
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "close mycur2" , ECPGt_EOIT , ECPGt_EORT );
375
- #line 173 "sqlda.pgc"
370
+ #line 168 "sqlda.pgc"
376
371
377
372
if (sqlca .sqlcode < 0 ) exit (1 );}
378
- #line 173 "sqlda.pgc"
373
+ #line 168 "sqlda.pgc"
379
374
380
375
381
376
strcpy (msg , "deallocate" );
382
377
{ ECPGdeallocate (__LINE__ , 0 , NULL , "st_id2" );
383
- #line 176 "sqlda.pgc"
378
+ #line 171 "sqlda.pgc"
384
379
385
380
if (sqlca .sqlcode < 0 ) exit (1 );}
386
- #line 176 "sqlda.pgc"
381
+ #line 171 "sqlda.pgc"
387
382
388
383
389
384
/* SQLDA test for getting one record using an input descriptor */
@@ -407,10 +402,10 @@ if (sqlca.sqlcode < 0) exit (1);}
407
402
408
403
strcpy (msg , "prepare" );
409
404
{ ECPGprepare (__LINE__ , NULL , 0 , "st_id3" , stmt2 );
410
- #line 198 "sqlda.pgc"
405
+ #line 193 "sqlda.pgc"
411
406
412
407
if (sqlca .sqlcode < 0 ) exit (1 );}
413
- #line 198 "sqlda.pgc"
408
+ #line 193 "sqlda.pgc"
414
409
415
410
416
411
strcpy (msg , "execute" );
@@ -419,20 +414,20 @@ if (sqlca.sqlcode < 0) exit (1);}
419
414
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT ,
420
415
ECPGt_sqlda , & outp_sqlda , 0L , 0L , 0L ,
421
416
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
422
- #line 201 "sqlda.pgc"
417
+ #line 196 "sqlda.pgc"
423
418
424
419
if (sqlca .sqlcode < 0 ) exit (1 );}
425
- #line 201 "sqlda.pgc"
420
+ #line 196 "sqlda.pgc"
426
421
427
422
428
423
dump_sqlda (outp_sqlda );
429
424
430
425
strcpy (msg , "deallocate" );
431
426
{ ECPGdeallocate (__LINE__ , 0 , NULL , "st_id3" );
432
- #line 206 "sqlda.pgc"
427
+ #line 201 "sqlda.pgc"
433
428
434
429
if (sqlca .sqlcode < 0 ) exit (1 );}
435
- #line 206 "sqlda.pgc"
430
+ #line 201 "sqlda.pgc"
436
431
437
432
438
433
free (inp_sqlda );
@@ -443,10 +438,10 @@ if (sqlca.sqlcode < 0) exit (1);}
443
438
*/
444
439
445
440
{ ECPGconnect (__LINE__ , 0 , "ecpg1_regression" , NULL , NULL , "con2" , 0 );
446
- #line 215 "sqlda.pgc"
441
+ #line 210 "sqlda.pgc"
447
442
448
443
if (sqlca .sqlcode < 0 ) exit (1 );}
449
- #line 215 "sqlda.pgc"
444
+ #line 210 "sqlda.pgc"
450
445
451
446
452
447
/*
@@ -468,10 +463,10 @@ if (sqlca.sqlcode < 0) exit (1);}
468
463
469
464
strcpy (msg , "prepare" );
470
465
{ ECPGprepare (__LINE__ , "con2" , 0 , "st_id4" , stmt2 );
471
- #line 235 "sqlda.pgc"
466
+ #line 230 "sqlda.pgc"
472
467
473
468
if (sqlca .sqlcode < 0 ) exit (1 );}
474
- #line 235 "sqlda.pgc"
469
+ #line 230 "sqlda.pgc"
475
470
476
471
477
472
strcpy (msg , "execute" );
@@ -480,65 +475,65 @@ if (sqlca.sqlcode < 0) exit (1);}
480
475
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EOIT ,
481
476
ECPGt_sqlda , & outp_sqlda , 0L , 0L , 0L ,
482
477
ECPGt_NO_INDICATOR , NULL , 0L , 0L , 0L , ECPGt_EORT );
483
- #line 238 "sqlda.pgc"
478
+ #line 233 "sqlda.pgc"
484
479
485
480
if (sqlca .sqlcode < 0 ) exit (1 );}
486
- #line 238 "sqlda.pgc"
481
+ #line 233 "sqlda.pgc"
487
482
488
483
489
484
dump_sqlda (outp_sqlda );
490
485
491
486
strcpy (msg , "commit" );
492
487
{ ECPGtrans (__LINE__ , "con2" , "commit" );
493
- #line 243 "sqlda.pgc"
488
+ #line 238 "sqlda.pgc"
494
489
495
490
if (sqlca .sqlcode < 0 ) exit (1 );}
496
- #line 243 "sqlda.pgc"
491
+ #line 238 "sqlda.pgc"
497
492
498
493
499
494
strcpy (msg , "deallocate" );
500
495
{ ECPGdeallocate (__LINE__ , 0 , NULL , "st_id4" );
501
- #line 246 "sqlda.pgc"
496
+ #line 241 "sqlda.pgc"
502
497
503
498
if (sqlca .sqlcode < 0 ) exit (1 );}
504
- #line 246 "sqlda.pgc"
499
+ #line 241 "sqlda.pgc"
505
500
506
501
507
502
free (inp_sqlda );
508
503
free (outp_sqlda );
509
504
510
505
strcpy (msg , "disconnect" );
511
506
{ ECPGdisconnect (__LINE__ , "con2" );
512
- #line 252 "sqlda.pgc"
507
+ #line 247 "sqlda.pgc"
513
508
514
509
if (sqlca .sqlcode < 0 ) exit (1 );}
515
- #line 252 "sqlda.pgc"
510
+ #line 247 "sqlda.pgc"
516
511
517
512
518
513
/* End test */
519
514
520
515
strcpy (msg , "drop" );
521
516
{ ECPGdo (__LINE__ , 0 , 1 , NULL , 0 , ECPGst_normal , "drop table t1" , ECPGt_EOIT , ECPGt_EORT );
522
- #line 257 "sqlda.pgc"
517
+ #line 252 "sqlda.pgc"
523
518
524
519
if (sqlca .sqlcode < 0 ) exit (1 );}
525
- #line 257 "sqlda.pgc"
520
+ #line 252 "sqlda.pgc"
526
521
527
522
528
523
strcpy (msg , "commit" );
529
524
{ ECPGtrans (__LINE__ , NULL , "commit" );
530
- #line 260 "sqlda.pgc"
525
+ #line 255 "sqlda.pgc"
531
526
532
527
if (sqlca .sqlcode < 0 ) exit (1 );}
533
- #line 260 "sqlda.pgc"
528
+ #line 255 "sqlda.pgc"
534
529
535
530
536
531
strcpy (msg , "disconnect" );
537
532
{ ECPGdisconnect (__LINE__ , "CURRENT" );
538
- #line 263 "sqlda.pgc"
533
+ #line 258 "sqlda.pgc"
539
534
540
535
if (sqlca .sqlcode < 0 ) exit (1 );}
541
- #line 263 "sqlda.pgc"
536
+ #line 258 "sqlda.pgc"
542
537
543
538
544
539
return 0 ;
0 commit comments