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))
9#line 1 "indicators.pgc"
14#ifndef POSTGRES_SQLCA_H
15 #define POSTGRES_SQLCA_H
18#if defined(WIN32) || defined(__CYGWIN__)
19#define PGDLLIMPORT __declspec (dllimport)
22#endif /* __CYGWIN__ */
23#endif /* PGDLLIMPORT */
25 #define SQLERRMC_LEN 150
44 /* Element 0: empty */
45 /* 1: OID of processed tuple if applicable */
46 /* 2: number of rows processed */
47 /* after an INSERT, UPDATE or */
48 /* DELETE statement */
53 /* Element 0: set to 'W' if at least one other is 'W' */
54 /* 1: if 'W' at least one character string */
55 /* value was truncated when it was */
56 /* stored into a host variable. */
59 * 2: if 'W' a (hopefully) non-fatal notice occurred
71#ifndef POSTGRES_ECPG_INTERNAL
72 #define sqlca (*ECPGget_sqlca())
81#line 3 "indicators.pgc"
91#line 4 "indicators.pgc"
96 /* exec sql begin declare section */
100#line 9 "indicators.pgc"
103#line 10 "indicators.pgc"
105/* exec sql end declare section */
106#line 11 "indicators.pgc"
111 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0); }
112#line 15 "indicators.pgc"
115#line 16 "indicators.pgc"
118 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table indicator_test ( \"id\" int primary key , \"str\" text not null , val int null )",
ECPGt_EOIT,
ECPGt_EORT);}
119#line 21 "indicators.pgc"
121 {
ECPGtrans(__LINE__, NULL,
"commit work");}
122#line 22 "indicators.pgc"
125 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into indicator_test ( id , str , val ) values ( 1 , 'Hello' , 0 )",
ECPGt_EOIT,
ECPGt_EORT);}
126#line 24 "indicators.pgc"
129 /* use indicator in insert */
130 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into indicator_test ( id , str , val ) values ( 2 , 'Hi there' , 1ドル )",
131 ECPGt_int,&(intvar),(
long)1,(
long)1,
sizeof(
int),
133#line 27 "indicators.pgc"
136 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into indicator_test ( id , str , val ) values ( 3 , 'Good evening' , 1ドル )",
137 ECPGt_int,&(intvar),(
long)1,(
long)1,
sizeof(
int),
139#line 29 "indicators.pgc"
141 {
ECPGtrans(__LINE__, NULL,
"commit work");}
142#line 30 "indicators.pgc"
145 /* use indicators to get information about selects */
147 ECPGt_int,&(intvar),(
long)1,(
long)1,
sizeof(
int),
149#line 33 "indicators.pgc"
152 ECPGt_int,&(intvar),(
long)1,(
long)1,
sizeof(
int),
154#line 34 "indicators.pgc"
156 printf(
"intvar: %d, nullind: %d\n", intvar, nullind);
158 ECPGt_int,&(intvar),(
long)1,(
long)1,
sizeof(
int),
160#line 36 "indicators.pgc"
162 printf(
"intvar: %d, nullind: %d\n", intvar, nullind);
164 /* use indicators for update */
165 intvar = 5; nullind = -1;
166 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"update indicator_test set val = 1ドル where id = 1",
167 ECPGt_int,&(intvar),(
long)1,(
long)1,
sizeof(
int),
169#line 41 "indicators.pgc"
172 ECPGt_int,&(intvar),(
long)1,(
long)1,
sizeof(
int),
174#line 42 "indicators.pgc"
176 printf(
"intvar: %d, nullind: %d\n", intvar, nullind);
179#line 45 "indicators.pgc"
181 {
ECPGtrans(__LINE__, NULL,
"commit work");}
182#line 46 "indicators.pgc"
186#line 48 "indicators.pgc"
bool ECPGsetcommit(int lineno, const char *mode, const char *connection_name)
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 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)
struct sqlca_t * ECPGget_sqlca(void)
char sqlerrmc[SQLERRMC_LEN]
struct sqlca_t::@172 sqlerrm