40 #line 12 "describe.pgc" 41 char * stmt1 =
"SELECT id, t FROM t1" ;
43 #line 13 "describe.pgc" 44 char * stmt2 =
"SELECT id, t FROM t1 WHERE id = -1" ;
46 #line 14 "describe.pgc" 47 int i , count1 , count2 , count3 , count4 ;
49 #line 15 "describe.pgc" 50 char field_name1 [ 30 ] =
"not set" ;
52 #line 16 "describe.pgc" 53 char field_name2 [ 30 ] =
"not set" ;
55 #line 17 "describe.pgc" 56 char field_name3 [ 30 ] =
"not set" ;
58 #line 18 "describe.pgc" 59 char field_name4 [ 30 ] =
"not set" ;
61 #line 19 "describe.pgc" 68 strcpy(msg,
"connect");
69 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
70 #line 26 "describe.pgc" 72 if (
sqlca.sqlcode < 0) exit (1);}
73 #line 26 "describe.pgc" 78 #line 29 "describe.pgc" 80 if (
sqlca.sqlcode < 0) exit (1);}
81 #line 29 "describe.pgc" 84 strcpy(msg,
"create");
86 #line 32 "describe.pgc" 88 if (
sqlca.sqlcode < 0) exit (1);}
89 #line 32 "describe.pgc" 92 strcpy(msg,
"insert");
93 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'a' )",
ECPGt_EOIT,
ECPGt_EORT);
94 #line 35 "describe.pgc" 96 if (
sqlca.sqlcode < 0) exit (1);}
97 #line 35 "describe.pgc" 99 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'b' )",
ECPGt_EOIT,
ECPGt_EORT);
100 #line 36 "describe.pgc" 102 if (
sqlca.sqlcode < 0) exit (1);}
103 #line 36 "describe.pgc" 105 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'c' )",
ECPGt_EOIT,
ECPGt_EORT);
106 #line 37 "describe.pgc" 108 if (
sqlca.sqlcode < 0) exit (1);}
109 #line 37 "describe.pgc" 111 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into t1 ( id , t ) values ( default , 'd' )",
ECPGt_EOIT,
ECPGt_EORT);
112 #line 38 "describe.pgc" 114 if (
sqlca.sqlcode < 0) exit (1);}
115 #line 38 "describe.pgc" 118 strcpy(msg,
"commit");
120 #line 41 "describe.pgc" 122 if (
sqlca.sqlcode < 0) exit (1);}
123 #line 41 "describe.pgc" 131 strcpy(msg,
"allocate");
133 #line 49 "describe.pgc" 135 if (
sqlca.sqlcode < 0) exit (1);
136 #line 49 "describe.pgc" 139 #line 50 "describe.pgc" 141 if (
sqlca.sqlcode < 0) exit (1);
142 #line 50 "describe.pgc" 145 #line 51 "describe.pgc" 147 if (
sqlca.sqlcode < 0) exit (1);
148 #line 51 "describe.pgc" 151 #line 52 "describe.pgc" 153 if (
sqlca.sqlcode < 0) exit (1);
154 #line 52 "describe.pgc" 157 strcpy(msg,
"prepare");
159 #line 55 "describe.pgc" 161 if (
sqlca.sqlcode < 0) exit (1);}
162 #line 55 "describe.pgc" 165 strcpy(msg,
"describe");
169 #line 58 "describe.pgc" 174 #line 59 "describe.pgc" 179 #line 60 "describe.pgc" 184 #line 61 "describe.pgc" 187 strcpy(msg,
"get descriptor");
190 #line 64 "describe.pgc" 192 if (
sqlca.sqlcode < 0) exit (1);}
193 #line 64 "describe.pgc" 197 #line 65 "describe.pgc" 199 if (
sqlca.sqlcode < 0) exit (1);}
200 #line 65 "describe.pgc" 204 #line 66 "describe.pgc" 206 if (
sqlca.sqlcode < 0) exit (1);}
207 #line 66 "describe.pgc" 211 #line 67 "describe.pgc" 213 if (
sqlca.sqlcode < 0) exit (1);}
214 #line 67 "describe.pgc" 217 if (!(count1 == count2 && count1 == count3 && count1 == count4))
220 for (i = 1; i <= count1; i++)
225 #line 74 "describe.pgc" 227 if (
sqlca.sqlcode < 0) exit (1);}
228 #line 74 "describe.pgc" 233 #line 75 "describe.pgc" 235 if (
sqlca.sqlcode < 0) exit (1);}
236 #line 75 "describe.pgc" 241 #line 76 "describe.pgc" 243 if (
sqlca.sqlcode < 0) exit (1);}
244 #line 76 "describe.pgc" 249 #line 77 "describe.pgc" 251 if (
sqlca.sqlcode < 0) exit (1);}
252 #line 77 "describe.pgc" 254 printf(
"field_name 1 '%s' 2 '%s' 3 '%s' 4 '%s'\n",
255 field_name1, field_name2, field_name3, field_name4);
258 strcpy(msg,
"deallocate");
260 #line 83 "describe.pgc" 262 if (
sqlca.sqlcode < 0) exit (1);
263 #line 83 "describe.pgc" 266 #line 84 "describe.pgc" 268 if (
sqlca.sqlcode < 0) exit (1);
269 #line 84 "describe.pgc" 272 #line 85 "describe.pgc" 274 if (
sqlca.sqlcode < 0) exit (1);
275 #line 85 "describe.pgc" 278 #line 86 "describe.pgc" 280 if (
sqlca.sqlcode < 0) exit (1);
281 #line 86 "describe.pgc" 285 #line 88 "describe.pgc" 287 if (
sqlca.sqlcode < 0) exit (1);}
288 #line 88 "describe.pgc" 293 strcpy(msg,
"allocate");
295 #line 93 "describe.pgc" 297 if (
sqlca.sqlcode < 0) exit (1);
298 #line 93 "describe.pgc" 301 #line 94 "describe.pgc" 303 if (
sqlca.sqlcode < 0) exit (1);
304 #line 94 "describe.pgc" 307 #line 95 "describe.pgc" 309 if (
sqlca.sqlcode < 0) exit (1);
310 #line 95 "describe.pgc" 313 #line 96 "describe.pgc" 315 if (
sqlca.sqlcode < 0) exit (1);
316 #line 96 "describe.pgc" 319 strcpy(msg,
"prepare");
321 #line 99 "describe.pgc" 323 if (
sqlca.sqlcode < 0) exit (1);}
324 #line 99 "describe.pgc" 327 strcpy(msg,
"describe");
331 #line 102 "describe.pgc" 336 #line 103 "describe.pgc" 341 #line 104 "describe.pgc" 346 #line 105 "describe.pgc" 349 strcpy(msg,
"get descriptor");
352 #line 108 "describe.pgc" 354 if (
sqlca.sqlcode < 0) exit (1);}
355 #line 108 "describe.pgc" 359 #line 109 "describe.pgc" 361 if (
sqlca.sqlcode < 0) exit (1);}
362 #line 109 "describe.pgc" 366 #line 110 "describe.pgc" 368 if (
sqlca.sqlcode < 0) exit (1);}
369 #line 110 "describe.pgc" 373 #line 111 "describe.pgc" 375 if (
sqlca.sqlcode < 0) exit (1);}
376 #line 111 "describe.pgc" 379 if (!(count1 == count2 && count1 == count3 && count1 == count4))
382 for (i = 1; i <= count1; i++)
387 #line 118 "describe.pgc" 389 if (
sqlca.sqlcode < 0) exit (1);}
390 #line 118 "describe.pgc" 395 #line 119 "describe.pgc" 397 if (
sqlca.sqlcode < 0) exit (1);}
398 #line 119 "describe.pgc" 403 #line 120 "describe.pgc" 405 if (
sqlca.sqlcode < 0) exit (1);}
406 #line 120 "describe.pgc" 411 #line 121 "describe.pgc" 413 if (
sqlca.sqlcode < 0) exit (1);}
414 #line 121 "describe.pgc" 416 printf(
"field_name 1 '%s' 2 '%s' 3 '%s' 4 '%s'\n",
417 field_name1, field_name2, field_name3, field_name4);
420 strcpy(msg,
"deallocate");
422 #line 127 "describe.pgc" 424 if (
sqlca.sqlcode < 0) exit (1);
425 #line 127 "describe.pgc" 428 #line 128 "describe.pgc" 430 if (
sqlca.sqlcode < 0) exit (1);
431 #line 128 "describe.pgc" 434 #line 129 "describe.pgc" 436 if (
sqlca.sqlcode < 0) exit (1);
437 #line 129 "describe.pgc" 440 #line 130 "describe.pgc" 442 if (
sqlca.sqlcode < 0) exit (1);
443 #line 130 "describe.pgc" 447 #line 132 "describe.pgc" 449 if (
sqlca.sqlcode < 0) exit (1);}
450 #line 132 "describe.pgc" 458 #line 138 "describe.pgc" 460 if (
sqlca.sqlcode < 0) exit (1);}
461 #line 138 "describe.pgc" 464 strcpy(msg,
"commit");
466 #line 141 "describe.pgc" 468 if (
sqlca.sqlcode < 0) exit (1);}
469 #line 141 "describe.pgc" 472 strcpy(msg,
"disconnect");
474 #line 144 "describe.pgc" 476 if (
sqlca.sqlcode < 0) exit (1);}
477 #line 144 "describe.pgc"
bool ECPGdisconnect(int lineno, const char *connection_name)
bool ECPGallocate_desc(int line, const char *name)
bool ECPGdo(const int lineno, const int compat, const int force_indicator, const char *connection_name, const bool questionmarks, const int st, const char *query,...)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
bool ECPGdescribe(int line, int compat, bool input, const char *connection_name, const char *stmt_name,...)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGget_desc(int lineno, const char *desc_name, int index,...)
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
bool ECPGget_desc_header(int lineno, const char *desc_name, int *count)
bool ECPGdeallocate_desc(int line, const char *name)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)