7 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
9 #line 1 "outofscope.pgc"
16 #line 1 "regression.h"
23 #line 6 "outofscope.pgc"
27 #line 1 "pgtypes_numeric.h"
28 #ifndef PGTYPES_NUMERIC
29 #define PGTYPES_NUMERIC
33 #define NUMERIC_POS 0x0000
34 #define NUMERIC_NEG 0x4000
35 #define NUMERIC_NAN 0xC000
36 #define NUMERIC_NULL 0xF000
37 #define NUMERIC_MAX_PRECISION 1000
38 #define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
39 #define NUMERIC_MIN_DISPLAY_SCALE 0
40 #define NUMERIC_MIN_SIG_DIGITS 16
98 #line 8 "outofscope.pgc"
130 #line 11 "outofscope.pgc"
163 #line 12 "outofscope.pgc"
167 #line 14 "outofscope.pgc"
179 #line 22 "outofscope.pgc"
182 #line 23 "outofscope.pgc"
185 #line 24 "outofscope.pgc"
191 ECPGset_var( 1, ( mynullvar ), __LINE__);\
193 #line 28 "outofscope.pgc"
196 #line 28 "outofscope.pgc"
198 #line 28 "outofscope.pgc"
201 if (
sqlca.sqlcode != 0)
205 *mynullvar0 = mynullvar;
222 #line 40 "outofscope.pgc"
225 #line 40 "outofscope.pgc"
243 #line 46 "outofscope.pgc"
246 #line 46 "outofscope.pgc"
254 #line 52 "outofscope.pgc"
257 #line 52 "outofscope.pgc"
271 strcpy(msg,
"connect");
272 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
273 #line 66 "outofscope.pgc"
276 #line 66 "outofscope.pgc"
281 #line 69 "outofscope.pgc"
284 #line 69 "outofscope.pgc"
287 strcpy(msg,
"create");
288 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table a1 ( id serial primary key , t text , d1 numeric , d2 float8 , c character ( 10 ) )",
ECPGt_EOIT,
ECPGt_EORT);
289 #line 72 "outofscope.pgc"
292 #line 72 "outofscope.pgc"
295 strcpy(msg,
"insert");
296 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'a' , 1.0 , 2 , 'a' )",
ECPGt_EOIT,
ECPGt_EORT);
297 #line 75 "outofscope.pgc"
300 #line 75 "outofscope.pgc"
302 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into a1 ( id , t , d1 , d2 , c ) values ( default , null , null , null , null )",
ECPGt_EOIT,
ECPGt_EORT);
303 #line 76 "outofscope.pgc"
306 #line 76 "outofscope.pgc"
308 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into a1 ( id , t , d1 , d2 , c ) values ( default , 'b' , 2.0 , 3 , 'b' )",
ECPGt_EOIT,
ECPGt_EORT);
309 #line 77 "outofscope.pgc"
312 #line 77 "outofscope.pgc"
315 strcpy(msg,
"commit");
317 #line 80 "outofscope.pgc"
320 #line 80 "outofscope.pgc"
328 for (loopcount = 0; loopcount < 100; loopcount++)
330 memset(myvar, 0,
sizeof(
MYTYPE));
334 printf(
"id=%d%s t='%s'%s d1=%f%s d2=%f%s c = '%s'%s\n",
335 myvar->
id, mynullvar->
id ?
" (NULL)" :
"",
336 myvar->
t, mynullvar->
t ?
" (NULL)" :
"",
337 myvar->
d1, mynullvar->
d1 ?
" (NULL)" :
"",
338 myvar->
d2, mynullvar->
d2 ?
" (NULL)" :
"",
339 myvar->
c, mynullvar->
c ?
" (NULL)" :
"");
349 #line 107 "outofscope.pgc"
352 #line 107 "outofscope.pgc"
355 strcpy(msg,
"commit");
357 #line 110 "outofscope.pgc"
360 #line 110 "outofscope.pgc"
363 strcpy(msg,
"disconnect");
365 #line 113 "outofscope.pgc"
368 #line 113 "outofscope.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,...)
void ECPGset_var(int number, void *pointer, int lineno)
bool ECPGtrans(int lineno, const char *connection_name, const char *transaction)
void * ECPGget_var(int number)
void PGTYPESdecimal_free(decimal *)
int PGTYPESnumeric_to_double(numeric *, double *)
int PGTYPESnumeric_to_long(numeric *, long *)
int PGTYPESnumeric_from_int(signed int, numeric *)
int PGTYPESnumeric_mul(numeric *, numeric *, numeric *)
int PGTYPESnumeric_from_decimal(decimal *, numeric *)
int PGTYPESnumeric_sub(numeric *, numeric *, numeric *)
int PGTYPESnumeric_to_int(numeric *, int *)
char * PGTYPESnumeric_to_asc(numeric *, int)
static void open_cur1(void)
static void close_cur1(void)
static void get_record1(void)
int PGTYPESnumeric_copy(numeric *, numeric *)
numeric * PGTYPESnumeric_new(void)
int PGTYPESnumeric_div(numeric *, numeric *, numeric *)
int PGTYPESnumeric_add(numeric *, numeric *, numeric *)
int PGTYPESnumeric_from_double(double, numeric *)
int PGTYPESnumeric_cmp(numeric *, numeric *)
int PGTYPESnumeric_to_decimal(numeric *, decimal *)
int PGTYPESnumeric_from_long(signed long int, numeric *)
decimal * PGTYPESdecimal_new(void)
void PGTYPESnumeric_free(numeric *)
numeric * PGTYPESnumeric_from_asc(char *, char **)
unsigned char NumericDigit
static void get_var1(MYTYPE **myvar0, MYNULLTYPE **mynullvar0)