PostgreSQL Source Code  git master
compat_informix-sqlda.c File Reference
#include <ecpglib.h>
#include <ecpgerrno.h>
#include <sqlca.h>
#include <ecpg_informix.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "sqlda-native.h"
Include dependency graph for compat_informix-sqlda.c:

Go to the source code of this file.

Macros

#define ECPGdebug(X, Y)   ECPGdebug((X)+100,(Y))
 
#define ECPG_SQLDA_H
 
#define ECPG_SQLTYPES_H
 
#define CCHARTYPE   ECPGt_char
 
#define CSHORTTYPE   ECPGt_short
 
#define CINTTYPE   ECPGt_int
 
#define CLONGTYPE   ECPGt_long
 
#define CFLOATTYPE   ECPGt_float
 
#define CDOUBLETYPE   ECPGt_double
 
#define CDECIMALTYPE   ECPGt_decimal
 
#define CFIXCHARTYPE   108
 
#define CSTRINGTYPE   ECPGt_char
 
#define CDATETYPE   ECPGt_date
 
#define CMONEYTYPE   111
 
#define CDTIMETYPE   ECPGt_timestamp
 
#define CLOCATORTYPE   113
 
#define CVCHARTYPE   ECPGt_varchar
 
#define CINVTYPE   115
 
#define CFILETYPE   116
 
#define CINT8TYPE   ECPGt_long_long
 
#define CCOLLTYPE   118
 
#define CLVCHARTYPE   119
 
#define CFIXBINTYPE   120
 
#define CVARBINTYPE   121
 
#define CBOOLTYPE   ECPGt_bool
 
#define CROWTYPE   123
 
#define CLVCHARPTRTYPE   124
 
#define CTYPEMAX   25
 
#define SQLCHAR   ECPGt_char
 
#define SQLSMINT   ECPGt_short
 
#define SQLINT   ECPGt_int
 
#define SQLFLOAT   ECPGt_double
 
#define SQLSMFLOAT   ECPGt_float
 
#define SQLDECIMAL   ECPGt_decimal
 
#define SQLSERIAL   ECPGt_int
 
#define SQLDATE   ECPGt_date
 
#define SQLDTIME   ECPGt_timestamp
 
#define SQLTEXT   ECPGt_char
 
#define SQLVCHAR   ECPGt_char
 
#define SQLINTERVAL   ECPGt_interval
 
#define SQLNCHAR   ECPGt_char
 
#define SQLNVCHAR   ECPGt_char
 
#define SQLINT8   ECPGt_long
 
#define SQLSERIAL8   ECPGt_long
 

Typedefs

typedef struct sqlvar_struct sqlvar_t
 
typedef struct sqlda_struct sqlda_t
 

Functions

static void dump_sqlda (sqlda_t *sqlda)
 
int main (void)
 

Variables

sqlda_tinp_sqlda
 
sqlda_toutp_sqlda
 

Macro Definition Documentation

◆ CBOOLTYPE

#define CBOOLTYPE   ECPGt_bool

Definition at line 78 of file compat_informix-sqlda.c.

◆ CCHARTYPE

#define CCHARTYPE   ECPGt_char

Definition at line 57 of file compat_informix-sqlda.c.

◆ CCOLLTYPE

#define CCOLLTYPE   118

Definition at line 74 of file compat_informix-sqlda.c.

◆ CDATETYPE

#define CDATETYPE   ECPGt_date

Definition at line 66 of file compat_informix-sqlda.c.

◆ CDECIMALTYPE

#define CDECIMALTYPE   ECPGt_decimal

Definition at line 63 of file compat_informix-sqlda.c.

◆ CDOUBLETYPE

#define CDOUBLETYPE   ECPGt_double

Definition at line 62 of file compat_informix-sqlda.c.

◆ CDTIMETYPE

#define CDTIMETYPE   ECPGt_timestamp

Definition at line 68 of file compat_informix-sqlda.c.

◆ CFILETYPE

#define CFILETYPE   116

Definition at line 72 of file compat_informix-sqlda.c.

◆ CFIXBINTYPE

#define CFIXBINTYPE   120

Definition at line 76 of file compat_informix-sqlda.c.

◆ CFIXCHARTYPE

#define CFIXCHARTYPE   108

Definition at line 64 of file compat_informix-sqlda.c.

◆ CFLOATTYPE

#define CFLOATTYPE   ECPGt_float

Definition at line 61 of file compat_informix-sqlda.c.

◆ CINT8TYPE

#define CINT8TYPE   ECPGt_long_long

Definition at line 73 of file compat_informix-sqlda.c.

◆ CINTTYPE

#define CINTTYPE   ECPGt_int

Definition at line 59 of file compat_informix-sqlda.c.

◆ CINVTYPE

#define CINVTYPE   115

Definition at line 71 of file compat_informix-sqlda.c.

◆ CLOCATORTYPE

#define CLOCATORTYPE   113

Definition at line 69 of file compat_informix-sqlda.c.

◆ CLONGTYPE

#define CLONGTYPE   ECPGt_long

Definition at line 60 of file compat_informix-sqlda.c.

◆ CLVCHARPTRTYPE

#define CLVCHARPTRTYPE   124

Definition at line 80 of file compat_informix-sqlda.c.

◆ CLVCHARTYPE

#define CLVCHARTYPE   119

Definition at line 75 of file compat_informix-sqlda.c.

◆ CMONEYTYPE

#define CMONEYTYPE   111

Definition at line 67 of file compat_informix-sqlda.c.

◆ CROWTYPE

#define CROWTYPE   123

Definition at line 79 of file compat_informix-sqlda.c.

◆ CSHORTTYPE

#define CSHORTTYPE   ECPGt_short

Definition at line 58 of file compat_informix-sqlda.c.

◆ CSTRINGTYPE

#define CSTRINGTYPE   ECPGt_char

Definition at line 65 of file compat_informix-sqlda.c.

◆ CTYPEMAX

#define CTYPEMAX   25

Definition at line 81 of file compat_informix-sqlda.c.

◆ CVARBINTYPE

#define CVARBINTYPE   121

Definition at line 77 of file compat_informix-sqlda.c.

◆ CVCHARTYPE

#define CVCHARTYPE   ECPGt_varchar

Definition at line 70 of file compat_informix-sqlda.c.

◆ ECPG_SQLDA_H

#define ECPG_SQLDA_H

Definition at line 30 of file compat_informix-sqlda.c.

◆ ECPG_SQLTYPES_H

#define ECPG_SQLTYPES_H

Definition at line 53 of file compat_informix-sqlda.c.

◆ ECPGdebug

#define ECPGdebug (   X,
 
)    ECPGdebug((X)+100,(Y))

Definition at line 9 of file compat_informix-sqlda.c.

◆ SQLCHAR

#define SQLCHAR   ECPGt_char

Definition at line 86 of file compat_informix-sqlda.c.

◆ SQLDATE

#define SQLDATE   ECPGt_date

Definition at line 93 of file compat_informix-sqlda.c.

◆ SQLDECIMAL

#define SQLDECIMAL   ECPGt_decimal

Definition at line 91 of file compat_informix-sqlda.c.

◆ SQLDTIME

#define SQLDTIME   ECPGt_timestamp

Definition at line 94 of file compat_informix-sqlda.c.

◆ SQLFLOAT

#define SQLFLOAT   ECPGt_double

Definition at line 89 of file compat_informix-sqlda.c.

◆ SQLINT

#define SQLINT   ECPGt_int

Definition at line 88 of file compat_informix-sqlda.c.

◆ SQLINT8

#define SQLINT8   ECPGt_long

Definition at line 104 of file compat_informix-sqlda.c.

◆ SQLINTERVAL

#define SQLINTERVAL   ECPGt_interval

Definition at line 97 of file compat_informix-sqlda.c.

◆ SQLNCHAR

#define SQLNCHAR   ECPGt_char

Definition at line 98 of file compat_informix-sqlda.c.

◆ SQLNVCHAR

#define SQLNVCHAR   ECPGt_char

Definition at line 99 of file compat_informix-sqlda.c.

◆ SQLSERIAL

#define SQLSERIAL   ECPGt_int

Definition at line 92 of file compat_informix-sqlda.c.

◆ SQLSERIAL8

#define SQLSERIAL8   ECPGt_long

Definition at line 105 of file compat_informix-sqlda.c.

◆ SQLSMFLOAT

#define SQLSMFLOAT   ECPGt_float

Definition at line 90 of file compat_informix-sqlda.c.

◆ SQLSMINT

#define SQLSMINT   ECPGt_short

Definition at line 87 of file compat_informix-sqlda.c.

◆ SQLTEXT

#define SQLTEXT   ECPGt_char

Definition at line 95 of file compat_informix-sqlda.c.

◆ SQLVCHAR

#define SQLVCHAR   ECPGt_char

Definition at line 96 of file compat_informix-sqlda.c.

Typedef Documentation

◆ sqlda_t

typedef struct sqlda_struct sqlda_t

Definition at line 1 of file compat_informix-sqlda.c.

◆ sqlvar_t

typedef struct sqlvar_struct sqlvar_t

Definition at line 1 of file compat_informix-sqlda.c.

Function Documentation

◆ dump_sqlda()

static void dump_sqlda ( sqlda_t sqlda)
static

Definition at line 121 of file compat_informix-sqlda.c.

122 {
123  int i;
124 
125  if (sqlda == NULL)
126  {
127  printf("dump_sqlda called with NULL sqlda\n");
128  return;
129  }
130 
131  for (i = 0; i < sqlda->sqld; i++)
132  {
133  if (sqlda->sqlvar[i].sqlind && *(sqlda->sqlvar[i].sqlind) == -1)
134  printf("name sqlda descriptor: '%s' value NULL'\n", sqlda->sqlvar[i].sqlname);
135  else
136  switch (sqlda->sqlvar[i].sqltype)
137  {
138  case SQLCHAR:
139  printf("name sqlda descriptor: '%s' value '%s'\n", sqlda->sqlvar[i].sqlname, sqlda->sqlvar[i].sqldata);
140  break;
141  case SQLINT:
142  printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata);
143  break;
144  case SQLFLOAT:
145  printf("name sqlda descriptor: '%s' value %f\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata);
146  break;
147  case SQLDECIMAL:
148  {
149  char val[64];
150  dectoasc((decimal *)sqlda->sqlvar[i].sqldata, val, 64, -1);
151  printf("name sqlda descriptor: '%s' value DECIMAL '%s'\n", sqlda->sqlvar[i].sqlname, val);
152  break;
153  }
154  }
155  }
156 }
#define SQLCHAR
#define SQLFLOAT
#define SQLDECIMAL
#define SQLINT
long val
Definition: informix.c:670
int dectoasc(decimal *np, char *cp, int len, int right)
Definition: informix.c:362
int i
Definition: isn.c:73
#define printf(...)
Definition: port.h:244
struct sqlvar_struct sqlvar[1]
Definition: sqlda-native.h:40
struct sqlname sqlname
Definition: sqlda-native.h:30
char * sqldata
Definition: sqlda-native.h:28
short * sqlind
Definition: sqlda-native.h:29

References dectoasc(), i, printf, SQLCHAR, sqlda_struct::sqld, sqlvar_struct::sqldata, SQLDECIMAL, SQLFLOAT, sqlvar_struct::sqlind, SQLINT, sqlvar_struct::sqlname, sqlvar_struct::sqltype, sqlda_struct::sqlvar, and val.

Referenced by main().

◆ main()

int main ( void  )

Definition at line 159 of file compat_informix-sqlda.c.

160 {
161 /* exec sql begin declare section */
162 
163 
164 
165 
166 
167 #line 57 "sqlda.pgc"
168  char * stmt1 = "SELECT * FROM t1" ;
169 
170 #line 58 "sqlda.pgc"
171  char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ;
172 
173 #line 59 "sqlda.pgc"
174  int rec ;
175 
176 #line 60 "sqlda.pgc"
177  int id ;
178 /* exec sql end declare section */
179 #line 61 "sqlda.pgc"
180 
181 
182  char msg[128];
183 
184  ECPGdebug(1, stderr);
185 
186  strcpy(msg, "connect");
187  { ECPGconnect(__LINE__, 1, "ecpg1_regression" , NULL, NULL , "regress1", 0);
188 #line 68 "sqlda.pgc"
189 
190 if (sqlca.sqlcode < 0) exit (1);}
191 #line 68 "sqlda.pgc"
192 
193 
194  strcpy(msg, "set");
195  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
196 #line 71 "sqlda.pgc"
197 
198 if (sqlca.sqlcode < 0) exit (1);}
199 #line 71 "sqlda.pgc"
200 
201 
202  strcpy(msg, "create");
203  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) )", ECPGt_EOIT, ECPGt_EORT);
204 #line 79 "sqlda.pgc"
205 
206 if (sqlca.sqlcode < 0) exit (1);}
207 #line 79 "sqlda.pgc"
208 
209 
210  strcpy(msg, "insert");
211  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 4 , 'd' , 4.0 , 4 , 'd' )", ECPGt_EOIT, ECPGt_EORT);
212 #line 85 "sqlda.pgc"
213 
214 if (sqlca.sqlcode < 0) exit (1);}
215 #line 85 "sqlda.pgc"
216 
217 
218  strcpy(msg, "commit");
219  { ECPGtrans(__LINE__, NULL, "commit");
220 #line 88 "sqlda.pgc"
221 
222 if (sqlca.sqlcode < 0) exit (1);}
223 #line 88 "sqlda.pgc"
224 
225 
226  /* SQLDA test for getting all records from a table */
227 
228  outp_sqlda = NULL;
229 
230  strcpy(msg, "prepare");
231  { ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1);
232 #line 95 "sqlda.pgc"
233 
234 if (sqlca.sqlcode < 0) exit (1);}
235 #line 95 "sqlda.pgc"
236 
237 
238  strcpy(msg, "declare");
239  /* declare mycur1 cursor for $1 */
240 #line 98 "sqlda.pgc"
241 
242 
243  strcpy(msg, "open");
244  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1",
245  ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
246  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
247 #line 101 "sqlda.pgc"
248 
249 if (sqlca.sqlcode < 0) exit (1);}
250 #line 101 "sqlda.pgc"
251 
252 
253  /* exec sql whenever not found break ; */
254 #line 103 "sqlda.pgc"
255 
256 
257  rec = 0;
258  while (1)
259  {
260  strcpy(msg, "fetch");
261  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT,
262  ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
263  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
264 #line 109 "sqlda.pgc"
265 
266 if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
267 #line 109 "sqlda.pgc"
268 
269 if (sqlca.sqlcode < 0) exit (1);}
270 #line 109 "sqlda.pgc"
271 
272 
273  printf("FETCH RECORD %d\n", ++rec);
275  }
276 
277  /* exec sql whenever not found continue ; */
278 #line 115 "sqlda.pgc"
279 
280 
281  strcpy(msg, "close");
282  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
283 #line 118 "sqlda.pgc"
284 
285 if (sqlca.sqlcode < 0) exit (1);}
286 #line 118 "sqlda.pgc"
287 
288 
289  strcpy(msg, "deallocate");
290  { ECPGdeallocate(__LINE__, 1, NULL, "st_id1");
291 #line 121 "sqlda.pgc"
292 
293 if (sqlca.sqlcode < 0) exit (1);}
294 #line 121 "sqlda.pgc"
295 
296 
297  free(outp_sqlda);
298 
299  /* SQLDA test for getting all records from a table
300  using the Informix-specific FETCH ... USING DESCRIPTOR
301  */
302 
303  outp_sqlda = NULL;
304 
305  strcpy(msg, "prepare");
306  { ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1);
307 #line 132 "sqlda.pgc"
308 
309 if (sqlca.sqlcode < 0) exit (1);}
310 #line 132 "sqlda.pgc"
311 
312 
313  strcpy(msg, "declare");
314  /* declare mycur2 cursor for $1 */
315 #line 135 "sqlda.pgc"
316 
317 
318  strcpy(msg, "open");
319  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1",
320  ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
321  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
322 #line 138 "sqlda.pgc"
323 
324 if (sqlca.sqlcode < 0) exit (1);}
325 #line 138 "sqlda.pgc"
326 
327 
328  /* exec sql whenever not found break ; */
329 #line 140 "sqlda.pgc"
330 
331 
332  rec = 0;
333  while (1)
334  {
335  strcpy(msg, "fetch");
336  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch from mycur2", ECPGt_EOIT,
337  ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
338  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
339 #line 146 "sqlda.pgc"
340 
341 if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
342 #line 146 "sqlda.pgc"
343 
344 if (sqlca.sqlcode < 0) exit (1);}
345 #line 146 "sqlda.pgc"
346 
347 
348  printf("FETCH RECORD %d\n", ++rec);
350  }
351 
352  /* exec sql whenever not found continue ; */
353 #line 152 "sqlda.pgc"
354 
355 
356  strcpy(msg, "close");
357  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
358 #line 155 "sqlda.pgc"
359 
360 if (sqlca.sqlcode < 0) exit (1);}
361 #line 155 "sqlda.pgc"
362 
363 
364  strcpy(msg, "deallocate");
365  { ECPGdeallocate(__LINE__, 1, NULL, "st_id2");
366 #line 158 "sqlda.pgc"
367 
368 if (sqlca.sqlcode < 0) exit (1);}
369 #line 158 "sqlda.pgc"
370 
371 
372  free(outp_sqlda);
373 
374  /* SQLDA test for getting one record using an input descriptor */
375 
376  /* Input sqlda has to be built manually */
377  inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t));
378  memset(inp_sqlda, 0, sizeof(sqlda_t));
379  inp_sqlda->sqld = 1;
380  inp_sqlda->sqlvar = malloc(sizeof(sqlvar_t));
381  memset(inp_sqlda->sqlvar, 0, sizeof(sqlvar_t));
382 
384  inp_sqlda->sqlvar[0].sqldata = (char *)&id;
385 
386  printf("EXECUTE RECORD 4\n");
387 
388  id = 4;
389 
390  outp_sqlda = NULL;
391 
392  strcpy(msg, "prepare");
393  { ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2);
394 #line 181 "sqlda.pgc"
395 
396 if (sqlca.sqlcode < 0) exit (1);}
397 #line 181 "sqlda.pgc"
398 
399 
400  strcpy(msg, "execute");
401  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_execute, "st_id3",
402  ECPGt_sqlda, &inp_sqlda, 0L, 0L, 0L,
403  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
404  ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
405  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
406 #line 184 "sqlda.pgc"
407 
408 if (sqlca.sqlcode < 0) exit (1);}
409 #line 184 "sqlda.pgc"
410 
411 
413 
414  strcpy(msg, "deallocate");
415  { ECPGdeallocate(__LINE__, 1, NULL, "st_id3");
416 #line 189 "sqlda.pgc"
417 
418 if (sqlca.sqlcode < 0) exit (1);}
419 #line 189 "sqlda.pgc"
420 
421 
423  free(inp_sqlda);
424  free(outp_sqlda);
425 
426  /* SQLDA test for getting one record using an input descriptor
427  * on a named connection
428  */
429 
430  { ECPGconnect(__LINE__, 1, "ecpg1_regression" , NULL, NULL , "con2", 0);
431 #line 199 "sqlda.pgc"
432 
433 if (sqlca.sqlcode < 0) exit (1);}
434 #line 199 "sqlda.pgc"
435 
436 
437  /* Input sqlda has to be built manually */
438  inp_sqlda = (sqlda_t *)malloc(sizeof(sqlda_t));
439  memset(inp_sqlda, 0, sizeof(sqlda_t));
440  inp_sqlda->sqld = 1;
441  inp_sqlda->sqlvar = malloc(sizeof(sqlvar_t));
442  memset(inp_sqlda->sqlvar, 0, sizeof(sqlvar_t));
443 
445  inp_sqlda->sqlvar[0].sqldata = (char *)&id;
446 
447  printf("EXECUTE RECORD 4\n");
448 
449  id = 4;
450 
451  outp_sqlda = NULL;
452 
453  strcpy(msg, "prepare");
454  { ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2);
455 #line 218 "sqlda.pgc"
456 
457 if (sqlca.sqlcode < 0) exit (1);}
458 #line 218 "sqlda.pgc"
459 
460 
461  strcpy(msg, "execute");
462  { ECPGdo(__LINE__, 1, 1, "con2", 0, ECPGst_execute, "st_id4",
463  ECPGt_sqlda, &inp_sqlda, 0L, 0L, 0L,
464  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
465  ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
466  ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
467 #line 221 "sqlda.pgc"
468 
469 if (sqlca.sqlcode < 0) exit (1);}
470 #line 221 "sqlda.pgc"
471 
472 
474 
475  strcpy(msg, "commit");
476  { ECPGtrans(__LINE__, "con2", "commit");
477 #line 226 "sqlda.pgc"
478 
479 if (sqlca.sqlcode < 0) exit (1);}
480 #line 226 "sqlda.pgc"
481 
482 
483  strcpy(msg, "deallocate");
484  { ECPGdeallocate(__LINE__, 1, NULL, "st_id4");
485 #line 229 "sqlda.pgc"
486 
487 if (sqlca.sqlcode < 0) exit (1);}
488 #line 229 "sqlda.pgc"
489 
490 
492  free(inp_sqlda);
493  free(outp_sqlda);
494 
495  strcpy(msg, "disconnect");
496  { ECPGdisconnect(__LINE__, "con2");
497 #line 236 "sqlda.pgc"
498 
499 if (sqlca.sqlcode < 0) exit (1);}
500 #line 236 "sqlda.pgc"
501 
502 
503  /* End test */
504 
505  strcpy(msg, "drop");
506  { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT);
507 #line 241 "sqlda.pgc"
508 
509 if (sqlca.sqlcode < 0) exit (1);}
510 #line 241 "sqlda.pgc"
511 
512 
513  strcpy(msg, "commit");
514  { ECPGtrans(__LINE__, NULL, "commit");
515 #line 244 "sqlda.pgc"
516 
517 if (sqlca.sqlcode < 0) exit (1);}
518 #line 244 "sqlda.pgc"
519 
520 
521  strcpy(msg, "disconnect");
522  { ECPGdisconnect(__LINE__, "CURRENT");
523 #line 247 "sqlda.pgc"
524 
525 if (sqlca.sqlcode < 0) exit (1);}
526 #line 247 "sqlda.pgc"
527 
528 
529  return 0;
530 }
static void dump_sqlda(sqlda_t *sqlda)
sqlda_t * inp_sqlda
#define ECPGdebug(X, Y)
sqlda_t * outp_sqlda
bool ECPGdisconnect(int lineno, const char *connection_name)
Definition: connect.c:673
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
Definition: connect.c:255
#define ECPG_NOT_FOUND
Definition: ecpgerrno.h:10
@ ECPGst_normal
Definition: ecpgtype.h:97
@ ECPGst_execute
Definition: ecpgtype.h:98
@ ECPGt_EOIT
Definition: ecpgtype.h:62
@ ECPGt_sqlda
Definition: ecpgtype.h:66
@ ECPGt_char_variable
Definition: ecpgtype.h:60
@ ECPGt_NO_INDICATOR
Definition: ecpgtype.h:64
@ ECPGt_EORT
Definition: ecpgtype.h:63
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,...)
Definition: execute.c:2277
#define free(a)
Definition: header.h:65
#define malloc(a)
Definition: header.h:50
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
Definition: misc.c:160
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
Definition: prepare.c:217
char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno)
Definition: prepare.c:368
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
Definition: prepare.c:315
exit(1)
#define sqlca
Definition: sqlca.h:59

References dump_sqlda(), ECPG_NOT_FOUND, ECPGconnect(), ECPGdeallocate(), ECPGdebug, ECPGdisconnect(), ECPGdo(), ECPGprepare(), ECPGprepared_statement(), ECPGst_execute, ECPGst_normal, ECPGt_char_variable, ECPGt_EOIT, ECPGt_EORT, ECPGt_NO_INDICATOR, ECPGt_sqlda, ECPGtrans(), exit(), free, inp_sqlda, malloc, outp_sqlda, printf, sqlca, sqlda_struct::sqld, sqlvar_struct::sqldata, SQLINT, sqlvar_struct::sqltype, and sqlda_struct::sqlvar.

Variable Documentation

◆ inp_sqlda

sqlda_t* inp_sqlda

Definition at line 118 of file compat_informix-sqlda.c.

Referenced by main().

◆ outp_sqlda

sqlda_t * outp_sqlda

Definition at line 118 of file compat_informix-sqlda.c.

Referenced by main().