9 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y)) 11 #line 1 "test_informix2.pgc" 18 #ifndef POSTGRES_SQLCA_H 19 #define POSTGRES_SQLCA_H 22 #if defined(WIN32) || defined(__CYGWIN__) 23 #define PGDLLIMPORT __declspec (dllimport) 29 #define SQLERRMC_LEN 150 75 #ifndef POSTGRES_ECPG_INTERNAL 76 #define sqlca (*ECPGget_sqlca()) 85 #line 5 "test_informix2.pgc" 88 #line 1 "regression.h" 95 #line 6 "test_informix2.pgc" 100 static void sql_check(
const char *
fn,
const char *caller,
int ignore)
102 char errorstring[255];
111 sprintf(errorstring,
"**SQL error %ld doing '%s' in function '%s'. [%s]",
113 fprintf(stderr,
"%s", errorstring);
114 printf(
"%s\n", errorstring);
117 {
ECPGtrans(__LINE__, NULL,
"rollback");}
118 #line 27 "test_informix2.pgc" 123 sprintf(errorstring,
"Rollback successful.\n");
125 sprintf(errorstring,
"Rollback failed with code %ld.\n",
SQLCODE);
128 fprintf(stderr,
"%s", errorstring);
129 printf(
"%s\n", errorstring);
147 #line 49 "test_informix2.pgc" 150 #line 50 "test_informix2.pgc" 153 #line 51 "test_informix2.pgc" 156 #line 52 "test_informix2.pgc" 159 #line 53 "test_informix2.pgc" 162 #line 54 "test_informix2.pgc" 168 #line 58 "test_informix2.pgc" 173 strcpy(dbname,
"ecpg1_regression");
174 {
ECPGconnect(__LINE__, 1, dbname , NULL, NULL , NULL, 0);
175 #line 63 "test_informix2.pgc" 178 #line 63 "test_informix2.pgc" 183 #line 66 "test_informix2.pgc" 186 #line 66 "test_informix2.pgc" 189 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"create table history ( customerid integer , timestamp timestamp without time zone , action_taken char ( 5 ) , narrative varchar ( 100 ) )",
ECPGt_EOIT,
ECPGt_EORT);
190 #line 68 "test_informix2.pgc" 193 #line 68 "test_informix2.pgc" 197 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into history ( customerid , timestamp , action_taken , narrative ) values ( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' )",
ECPGt_EOIT,
ECPGt_EORT);
198 #line 73 "test_informix2.pgc" 201 #line 73 "test_informix2.pgc" 208 #line 78 "test_informix2.pgc" 211 #line 78 "test_informix2.pgc" 215 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"select customerid , timestamp from history where timestamp = $1 limit 1",
218 ECPGt_int,&(c),(
long)1,(
long)1,
sizeof(
int),
222 #line 85 "test_informix2.pgc" 225 #line 85 "test_informix2.pgc" 229 printf(
"Read in customer %d\n", c);
236 {
ECPGdo(__LINE__, 1, 1, NULL, 0,
ECPGst_normal,
"insert into history ( customerid , timestamp , action_taken , narrative ) values ( $1 , $2 , 'test' , 'test' )",
237 ECPGt_int,&(c),(
long)1,(
long)1,
sizeof(
int),
241 #line 97 "test_informix2.pgc" 244 #line 97 "test_informix2.pgc" 249 #line 100 "test_informix2.pgc" 252 #line 100 "test_informix2.pgc" 256 #line 102 "test_informix2.pgc" 259 #line 102 "test_informix2.pgc" 264 #line 105 "test_informix2.pgc" 267 #line 105 "test_informix2.pgc" 271 #line 107 "test_informix2.pgc" 274 #line 107 "test_informix2.pgc" bool ECPGdisconnect(int lineno, const char *connection_name)
struct sqlca_t::@134 sqlerrm
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 ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
interval * PGTYPESinterval_from_asc(char *, char **)
int PGTYPEStimestamp_add_interval(timestamp *tin, interval *span, timestamp *tout)
static void * fn(void *arg)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
char sqlerrmc[SQLERRMC_LEN]