55{
56
57
58
59
60
61
62
63#line 15 "describe.pgc"
64 char * stmt1 = "SELECT id, t FROM descr_t2" ;
65
66#line 16 "describe.pgc"
67 char * stmt2 = "SELECT id, t FROM descr_t2 WHERE id = -1" ;
68
69#line 17 "describe.pgc"
70 int i , count1 , count2 ;
71
72#line 18 "describe.pgc"
73 char field_name1 [ 30 ] = "not set" ;
74
75#line 19 "describe.pgc"
76 char field_name2 [ 30 ] = "not set" ;
77
78#line 20 "describe.pgc"
79
80
81 char msg[128];
82
84
85 strcpy(msg, "connect");
86 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
87#line 27 "describe.pgc"
88
90#line 27 "describe.pgc"
91
92
93 strcpy(msg, "set");
95#line 30 "describe.pgc"
96
98#line 30 "describe.pgc"
99
100
101 strcpy(msg, "create");
103#line 33 "describe.pgc"
104
106#line 33 "describe.pgc"
107
108
109 strcpy(msg, "insert");
110 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t2 ( id , t ) values ( default , 'a' )",
ECPGt_EOIT,
ECPGt_EORT);
111#line 36 "describe.pgc"
112
114#line 36 "describe.pgc"
115
116 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t2 ( id , t ) values ( default , 'b' )",
ECPGt_EOIT,
ECPGt_EORT);
117#line 37 "describe.pgc"
118
120#line 37 "describe.pgc"
121
122 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t2 ( id , t ) values ( default , 'c' )",
ECPGt_EOIT,
ECPGt_EORT);
123#line 38 "describe.pgc"
124
126#line 38 "describe.pgc"
127
128 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into descr_t2 ( id , t ) values ( default , 'd' )",
ECPGt_EOIT,
ECPGt_EORT);
129#line 39 "describe.pgc"
130
132#line 39 "describe.pgc"
133
134
135 strcpy(msg, "commit");
137#line 42 "describe.pgc"
138
140#line 42 "describe.pgc"
141
142
143
144
145
146
147
148
149 strcpy(msg, "allocate");
151#line 51 "describe.pgc"
152
154#line 51 "describe.pgc"
155
157#line 52 "describe.pgc"
158
160#line 52 "describe.pgc"
161
162
163 strcpy(msg, "prepare");
165#line 55 "describe.pgc"
166
168#line 55 "describe.pgc"
169
170
172
173 strcpy(msg, "describe");
177#line 60 "describe.pgc"
178
182#line 61 "describe.pgc"
183
184
188#line 63 "describe.pgc"
189
193#line 64 "describe.pgc"
194
198#line 65 "describe.pgc"
199
200
202 {
205 }
206
208 {
211 }
212
214 {
217 }
218
219 strcpy(msg, "get descriptor");
221
222#line 86 "describe.pgc"
223
225#line 86 "describe.pgc"
226
228
229#line 87 "describe.pgc"
230
232#line 87 "describe.pgc"
233
234
235 if (count1 != count2)
236 {
237 printf(
"count1 (%d) != count2 (%d)\n", count1, count2);
239 }
240
242 {
245 }
246
248 {
251 }
252
254 {
257 }
258
259 for (
i = 1;
i <= count1;
i++)
260 {
263
264#line 115 "describe.pgc"
265
267#line 115 "describe.pgc"
268
271
272#line 116 "describe.pgc"
273
275#line 116 "describe.pgc"
276
277 printf(
"%d\n\tfield_name1 '%s'\n\tfield_name2 '%s'\n\t"
278 "sqlda1 '%s'\n\tsqlda2 '%s'\n\tsqlda3 '%s'\n",
279 i, field_name1, field_name2,
283 }
284
285 strcpy(msg, "deallocate");
287#line 126 "describe.pgc"
288
290#line 126 "describe.pgc"
291
293#line 127 "describe.pgc"
294
296#line 127 "describe.pgc"
297
301
303#line 132 "describe.pgc"
304
306#line 132 "describe.pgc"
307
308
309
310
311 strcpy(msg, "allocate");
313#line 137 "describe.pgc"
314
316#line 137 "describe.pgc"
317
319#line 138 "describe.pgc"
320
322#line 138 "describe.pgc"
323
324
325 strcpy(msg, "prepare");
327#line 141 "describe.pgc"
328
330#line 141 "describe.pgc"
331
332
334
335 strcpy(msg, "describe");
339#line 146 "describe.pgc"
340
344#line 147 "describe.pgc"
345
346
350#line 149 "describe.pgc"
351
355#line 150 "describe.pgc"
356
360#line 151 "describe.pgc"
361
362
365
366 strcpy(msg, "get descriptor");
368
369#line 157 "describe.pgc"
370
372#line 157 "describe.pgc"
373
375
376#line 158 "describe.pgc"
377
379#line 158 "describe.pgc"
380
381
382 if (!( count1 == count2 &&
387
388 for (
i = 1;
i <= count1;
i++)
389 {
392
393#line 168 "describe.pgc"
394
396#line 168 "describe.pgc"
397
400
401#line 169 "describe.pgc"
402
404#line 169 "describe.pgc"
405
406 printf(
"%d\n\tfield_name1 '%s'\n\tfield_name2 '%s'\n\t"
407 "sqlda1 '%s'\n\tsqlda2 '%s'\n\tsqlda3 '%s'\n",
408 i, field_name1, field_name2,
412 }
413
414 strcpy(msg, "deallocate");
416#line 179 "describe.pgc"
417
419#line 179 "describe.pgc"
420
422#line 180 "describe.pgc"
423
425#line 180 "describe.pgc"
426
430
432#line 185 "describe.pgc"
433
435#line 185 "describe.pgc"
436
437
438
439
440 strcpy(msg, "drop");
442#line 190 "describe.pgc"
443
445#line 190 "describe.pgc"
446
447
448 strcpy(msg, "commit");
450#line 193 "describe.pgc"
451
453#line 193 "describe.pgc"
454
455
456 strcpy(msg, "disconnect");
458#line 196 "describe.pgc"
459
461#line 196 "describe.pgc"
462
463
464 return 0;
465}
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]