1
/* Processed by ecpg (regression mode) */
2
/* These include files are added by the preprocessor */
6
/* End of automatic include section */
7
#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
12
#ifndef POSTGRES_SQLCA_H
13
#define POSTGRES_SQLCA_H
16
#if defined(WIN32) || defined(__CYGWIN__)
17
#define PGDLLIMPORT __declspec (dllimport)
20
#endif /* __CYGWIN__ */
21
#endif /* PGDLLIMPORT */
23
#define SQLERRMC_LEN 150
38
char sqlerrmc[SQLERRMC_LEN];
42
/* Element 0: empty */
43
/* 1: OID of processed tuple if applicable */
44
/* 2: number of rows processed */
45
/* after an INSERT, UPDATE or */
46
/* DELETE statement */
51
/* Element 0: set to 'W' if at least one other is 'W' */
52
/* 1: if 'W' at least one character string */
53
/* value was truncated when it was */
54
/* stored into a host variable. */
57
* 2: if 'W' a (hopefully) non-fatal notice occurred
67
struct sqlca_t *ECPGget_sqlca(void);
69
#ifndef POSTGRES_ECPG_INTERNAL
70
#define sqlca (*ECPGget_sqlca())
82
enum e { ENUM0, ENUM1 };
83
struct sa { int member; };
94
printf("in fb (%d)\n", x);
101
printf("in fc (%s)\n", x);
105
static int fd(const char *x,int i)
107
printf("in fd (%s, %d)\n", x, i);
111
static int fe(enum e x)
113
printf("in fe (%d)\n", (int) x);
117
static void sqlnotice(char *notice, short trans)
121
printf("in sqlnotice (%s, %d)\n", notice, trans);
131
static const int i=2;
137
struct sa x = { 14 },*y = &x;
138
/* exec sql begin declare section */
159
int b2 = ( 14 * 7 ) ;
174
int e = y -> member ;
184
/* exec sql end declare section */
191
/* exec sql begin declare section */
196
/* exec sql end declare section */
201
ECPGdebug(1, stderr);
203
printf("%d %d %d %d %d %d %d %d %d %d %d\n", a, b, b2, c, d, e, f, g, h, i, j);
205
printf("%ld\n", iay);
206
/* exec sql whenever sqlerror do fa ( ) ; */
209
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select now ( )", ECPGt_EOIT, ECPGt_EORT);
212
if (sqlca.sqlcode < 0) fa ( );}
215
/* exec sql whenever sqlerror do fb ( 20 ) ; */
218
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select now ( )", ECPGt_EOIT, ECPGt_EORT);
221
if (sqlca.sqlcode < 0) fb ( 20 );}
224
/* exec sql whenever sqlerror do fc ( \"50\" ) ; */
227
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select now ( )", ECPGt_EOIT, ECPGt_EORT);
230
if (sqlca.sqlcode < 0) fc ( "50" );}
233
/* exec sql whenever sqlerror do fd ( \"50\" , 1 ) ; */
236
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select now ( )", ECPGt_EOIT, ECPGt_EORT);
239
if (sqlca.sqlcode < 0) fd ( "50" , 1 );}
242
/* exec sql whenever sqlerror do fe ( ENUM0 ) ; */
245
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select now ( )", ECPGt_EOIT, ECPGt_EORT);
248
if (sqlca.sqlcode < 0) fe ( ENUM0 );}
251
/* exec sql whenever sqlerror do sqlnotice ( NULL , 0 ) ; */
254
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select now ( )", ECPGt_EOIT, ECPGt_EORT);
257
if (sqlca.sqlcode < 0) sqlnotice ( NULL , 0 );}