57{
58
59
60
61
62
63
64
65#line 15 "describe.pgc"
66 char * stmt1 = "SELECT id, t FROM descr_t1" ;
67
68#line 16 "describe.pgc"
69 char * stmt2 = "SELECT id, t FROM descr_t1 WHERE id = -1" ;
70
71#line 17 "describe.pgc"
72 int i , count1 , count2 ;
73
74#line 18 "describe.pgc"
75 char field_name1 [ 30 ] = "not set" ;
76
77#line 19 "describe.pgc"
78 char field_name2 [ 30 ] = "not set" ;
79
80#line 20 "describe.pgc"
81
82
83 char msg[128];
84
86
87 strcpy(msg, "connect");
88 {
ECPGconnect(__LINE__, 1,
"ecpg1_regression" , NULL, NULL , NULL, 0);
89#line 27 "describe.pgc"
90
92#line 27 "describe.pgc"
93
94
95 strcpy(msg, "set");
97#line 30 "describe.pgc"
98
100#line 30 "describe.pgc"
101
102
103 strcpy(msg, "create");
105#line 33 "describe.pgc"
106
108#line 33 "describe.pgc"
109
110
111 strcpy(msg, "insert");
112 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t1 ( id , t ) values ( default , 'a' )",
ECPGt_EOIT,
ECPGt_EORT);
113#line 36 "describe.pgc"
114
116#line 36 "describe.pgc"
117
118 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t1 ( id , t ) values ( default , 'b' )",
ECPGt_EOIT,
ECPGt_EORT);
119#line 37 "describe.pgc"
120
122#line 37 "describe.pgc"
123
124 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t1 ( id , t ) values ( default , 'c' )",
ECPGt_EOIT,
ECPGt_EORT);
125#line 38 "describe.pgc"
126
128#line 38 "describe.pgc"
129
130 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t1 ( id , t ) values ( default , 'd' )",
ECPGt_EOIT,
ECPGt_EORT);
131#line 39 "describe.pgc"
132
134#line 39 "describe.pgc"
135
136
137 strcpy(msg, "commit");
139#line 42 "describe.pgc"
140
142#line 42 "describe.pgc"
143
144
145
146
147
148
149
150
151 strcpy(msg, "allocate");
153#line 51 "describe.pgc"
154
156#line 51 "describe.pgc"
157
159#line 52 "describe.pgc"
160
162#line 52 "describe.pgc"
163
164
165 strcpy(msg, "prepare");
167#line 55 "describe.pgc"
168
170#line 55 "describe.pgc"
171
172
174
175 strcpy(msg, "describe");
179#line 60 "describe.pgc"
180
184#line 61 "describe.pgc"
185
186
190#line 63 "describe.pgc"
191
195#line 64 "describe.pgc"
196
200#line 65 "describe.pgc"
201
202
204 {
207 }
208
210 {
213 }
214
216 {
219 }
220
221 strcpy(msg, "get descriptor");
223
224#line 86 "describe.pgc"
225
227#line 86 "describe.pgc"
228
230
231#line 87 "describe.pgc"
232
234#line 87 "describe.pgc"
235
236
237 if (count1 != count2)
238 {
239 printf(
"count1 (%d) != count2 (%d)\n", count1, count2);
241 }
242
244 {
247 }
248
250 {
253 }
254
256 {
259 }
260
261 for (
i = 1;
i <= count1;
i++)
262 {
265
266#line 115 "describe.pgc"
267
269#line 115 "describe.pgc"
270
273
274#line 116 "describe.pgc"
275
277#line 116 "describe.pgc"
278
279 printf(
"%d\n\tfield_name1 '%s'\n\tfield_name2 '%s'\n\t"
280 "sqlda1 '%s'\n\tsqlda2 '%s'\n\tsqlda3 '%s'\n",
281 i, field_name1, field_name2,
285 }
286
287 strcpy(msg, "deallocate");
289#line 126 "describe.pgc"
290
292#line 126 "describe.pgc"
293
295#line 127 "describe.pgc"
296
298#line 127 "describe.pgc"
299
303
305#line 132 "describe.pgc"
306
308#line 132 "describe.pgc"
309
310
311
312
313 strcpy(msg, "allocate");
315#line 137 "describe.pgc"
316
318#line 137 "describe.pgc"
319
321#line 138 "describe.pgc"
322
324#line 138 "describe.pgc"
325
326
327 strcpy(msg, "prepare");
329#line 141 "describe.pgc"
330
332#line 141 "describe.pgc"
333
334
336
337 strcpy(msg, "describe");
341#line 146 "describe.pgc"
342
346#line 147 "describe.pgc"
347
348
352#line 149 "describe.pgc"
353
357#line 150 "describe.pgc"
358
362#line 151 "describe.pgc"
363
364
367
368 strcpy(msg, "get descriptor");
370
371#line 157 "describe.pgc"
372
374#line 157 "describe.pgc"
375
377
378#line 158 "describe.pgc"
379
381#line 158 "describe.pgc"
382
383
384 if (!( count1 == count2 &&
389
390 for (
i = 1;
i <= count1;
i++)
391 {
394
395#line 168 "describe.pgc"
396
398#line 168 "describe.pgc"
399
402
403#line 169 "describe.pgc"
404
406#line 169 "describe.pgc"
407
408 printf(
"%d\n\tfield_name1 '%s'\n\tfield_name2 '%s'\n\t"
409 "sqlda1 '%s'\n\tsqlda2 '%s'\n\tsqlda3 '%s'\n",
410 i, field_name1, field_name2,
414 }
415
416 strcpy(msg, "deallocate");
418#line 179 "describe.pgc"
419
421#line 179 "describe.pgc"
422
424#line 180 "describe.pgc"
425
427#line 180 "describe.pgc"
428
432
434#line 185 "describe.pgc"
435
437#line 185 "describe.pgc"
438
439
440
441
442 strcpy(msg, "drop");
444#line 190 "describe.pgc"
445
447#line 190 "describe.pgc"
448
449
450 strcpy(msg, "commit");
452#line 193 "describe.pgc"
453
455#line 193 "describe.pgc"
456
457
458 strcpy(msg, "disconnect");
460#line 196 "describe.pgc"
461
463#line 196 "describe.pgc"
464
465
466 return 0;
467}
bool ECPGdisconnect(int lineno, const char *connection_name)
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdeallocate_desc(int line, const char *name)
bool ECPGget_desc(int lineno, const char *desc_name, int index,...)
bool ECPGallocate_desc(int line, const char *name)
bool ECPGdescribe(int line, int compat, bool input, const char *connection_name, const char *stmt_name,...)
bool ECPGget_desc_header(int lineno, const char *desc_name, int *count)
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 ECPGtrans(int lineno, const char *connection_name, const char *transaction)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
struct sqlvar_struct sqlvar[1]