7 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
13 #include "ecpg_config.h"
16 #line 1 "regression.h"
30 #ifdef _ECPG_INFORMIX_H
49 #line 1 "pgtypes_numeric.h"
50 #ifndef PGTYPES_NUMERIC
51 #define PGTYPES_NUMERIC
55 #define NUMERIC_POS 0x0000
56 #define NUMERIC_NEG 0x4000
57 #define NUMERIC_NAN 0xC000
58 #define NUMERIC_NULL 0xF000
59 #define NUMERIC_MAX_PRECISION 1000
60 #define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
61 #define NUMERIC_MIN_DISPLAY_SCALE 0
62 #define NUMERIC_MIN_SIG_DIGITS 16
137 printf(
"dump_sqlda called with NULL sqlda\n");
141 for (
i = 0;
i < sqlda->
sqld;
i++)
160 "name sqlda descriptor: '%s' value %I64d\n",
162 "name sqlda descriptor: '%s' value %lld\n",
192 char * stmt1 =
"SELECT * FROM t1" ;
195 char * stmt2 =
"SELECT * FROM t1 WHERE id = ?" ;
210 strcpy(msg,
"connect");
211 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL ,
"regress1", 0);
226 strcpy(msg,
"create");
227 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) , big bigint )",
ECPGt_EOIT,
ECPGt_EORT);
234 strcpy(msg,
"insert");
235 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' , 1111111111111111111 ) , ( 2 , null , null , null , null , null ) , ( 3 , 'c' , 0.0 , 3 , 'c' , 3333333333333333333 ) , ( 4 , 'd' , 'NaN' , 4 , 'd' , 4444444444444444444 ) , ( 5 , 'e' , 0.001234 , 5 , 'e' , 5555555555555555555 )",
ECPGt_EOIT,
ECPGt_EORT);
236 #line 103 "sqlda.pgc"
239 #line 103 "sqlda.pgc"
242 strcpy(msg,
"commit");
244 #line 106 "sqlda.pgc"
247 #line 106 "sqlda.pgc"
254 strcpy(msg,
"prepare");
256 #line 113 "sqlda.pgc"
259 #line 113 "sqlda.pgc"
262 strcpy(msg,
"declare");
264 #line 116 "sqlda.pgc"
271 #line 119 "sqlda.pgc"
274 #line 119 "sqlda.pgc"
278 #line 121 "sqlda.pgc"
284 strcpy(msg,
"fetch");
288 #line 127 "sqlda.pgc"
291 #line 127 "sqlda.pgc"
294 #line 127 "sqlda.pgc"
297 printf(
"FETCH RECORD %d\n", ++rec);
302 #line 133 "sqlda.pgc"
305 strcpy(msg,
"close");
307 #line 136 "sqlda.pgc"
310 #line 136 "sqlda.pgc"
313 strcpy(msg,
"deallocate");
315 #line 139 "sqlda.pgc"
318 #line 139 "sqlda.pgc"
327 strcpy(msg,
"prepare");
329 #line 148 "sqlda.pgc"
332 #line 148 "sqlda.pgc"
335 strcpy(msg,
"declare");
337 #line 151 "sqlda.pgc"
344 #line 154 "sqlda.pgc"
347 #line 154 "sqlda.pgc"
350 strcpy(msg,
"fetch");
354 #line 157 "sqlda.pgc"
357 #line 157 "sqlda.pgc"
365 printf(
"FETCH RECORD %d\n", ++rec);
373 strcpy(msg,
"close");
375 #line 173 "sqlda.pgc"
378 #line 173 "sqlda.pgc"
381 strcpy(msg,
"deallocate");
383 #line 176 "sqlda.pgc"
386 #line 176 "sqlda.pgc"
402 printf(
"EXECUTE RECORD 4\n");
408 strcpy(msg,
"prepare");
410 #line 198 "sqlda.pgc"
413 #line 198 "sqlda.pgc"
416 strcpy(msg,
"execute");
422 #line 201 "sqlda.pgc"
425 #line 201 "sqlda.pgc"
430 strcpy(msg,
"deallocate");
432 #line 206 "sqlda.pgc"
435 #line 206 "sqlda.pgc"
445 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL ,
"con2", 0);
446 #line 215 "sqlda.pgc"
449 #line 215 "sqlda.pgc"
463 printf(
"EXECUTE RECORD 4\n");
469 strcpy(msg,
"prepare");
470 {
ECPGprepare(__LINE__,
"con2", 0,
"st_id4", stmt2);
471 #line 235 "sqlda.pgc"
474 #line 235 "sqlda.pgc"
477 strcpy(msg,
"execute");
483 #line 238 "sqlda.pgc"
486 #line 238 "sqlda.pgc"
491 strcpy(msg,
"commit");
493 #line 243 "sqlda.pgc"
496 #line 243 "sqlda.pgc"
499 strcpy(msg,
"deallocate");
501 #line 246 "sqlda.pgc"
504 #line 246 "sqlda.pgc"
510 strcpy(msg,
"disconnect");
512 #line 252 "sqlda.pgc"
515 #line 252 "sqlda.pgc"
522 #line 257 "sqlda.pgc"
525 #line 257 "sqlda.pgc"
528 strcpy(msg,
"commit");
530 #line 260 "sqlda.pgc"
533 #line 260 "sqlda.pgc"
536 strcpy(msg,
"disconnect");
538 #line 263 "sqlda.pgc"
541 #line 263 "sqlda.pgc"
Datum numeric(PG_FUNCTION_ARGS)
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)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno)
bool ECPGdeallocate(int lineno, int c, const char *connection_name, const char *name)
void PGTYPESchar_free(char *ptr)
int PGTYPESnumeric_from_double(double d, numeric *dst)
int PGTYPESnumeric_copy(numeric *src, numeric *dst)
int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst)
int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst)
void PGTYPESdecimal_free(decimal *var)
int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result)
int PGTYPESnumeric_to_long(numeric *nv, long *lp)
int PGTYPESnumeric_to_double(numeric *nv, double *dp)
int PGTYPESnumeric_from_long(signed long int long_val, numeric *var)
int PGTYPESnumeric_to_int(numeric *nv, int *ip)
static void dump_sqlda(sqlda_t *sqlda)
char * PGTYPESnumeric_to_asc(numeric *num, int dscale)
numeric * PGTYPESnumeric_new(void)
int PGTYPESnumeric_from_int(signed int int_val, numeric *var)
int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result)
decimal * PGTYPESdecimal_new(void)
numeric * PGTYPESnumeric_from_asc(char *str, char **endptr)
void PGTYPESnumeric_free(numeric *var)
int PGTYPESnumeric_cmp(numeric *var1, numeric *var2)
int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result)
int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result)
unsigned char NumericDigit
struct sqlvar_struct sqlvar[1]
struct sqlda_struct * desc_next