7#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
13#include "ecpg_config.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++)
158 printf(
"name sqlda descriptor: '%s' value %lld\n",
187 char * stmt1 =
"SELECT * FROM t1" ;
190 char * stmt2 =
"SELECT * FROM t1 WHERE id = ?" ;
205 strcpy(msg,
"connect");
206 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL ,
"regress1", 0);
221 strcpy(msg,
"create");
222 {
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);
229 strcpy(msg,
"insert");
230 {
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);
237 strcpy(msg,
"commit");
249 strcpy(msg,
"prepare");
257 strcpy(msg,
"declare");
279 strcpy(msg,
"fetch");
292 printf(
"FETCH RECORD %d\n", ++rec);
300 strcpy(msg,
"close");
308 strcpy(msg,
"deallocate");
322 strcpy(msg,
"prepare");
330 strcpy(msg,
"declare");
345 strcpy(msg,
"fetch");
360 printf(
"FETCH RECORD %d\n", ++rec);
368 strcpy(msg,
"close");
376 strcpy(msg,
"deallocate");
397 printf(
"EXECUTE RECORD 4\n");
403 strcpy(msg,
"prepare");
411 strcpy(msg,
"execute");
425 strcpy(msg,
"deallocate");
440 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL ,
"con2", 0);
458 printf(
"EXECUTE RECORD 4\n");
464 strcpy(msg,
"prepare");
465 {
ECPGprepare(__LINE__,
"con2", 0,
"st_id4", stmt2);
472 strcpy(msg,
"execute");
486 strcpy(msg,
"commit");
494 strcpy(msg,
"deallocate");
505 strcpy(msg,
"disconnect");
523 strcpy(msg,
"commit");
531 strcpy(msg,
"disconnect");
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)
char * ECPGprepared_statement(const char *connection_name, const char *name, int lineno)
bool ECPGprepare(int lineno, const char *connection_name, const bool questionmarks, const char *name, const char *variable)
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)
numeric * PGTYPESnumeric_new(void)
int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst)
char * PGTYPESnumeric_to_asc(numeric *num, int dscale)
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)
int PGTYPESnumeric_from_int(signed int int_val, numeric *var)
int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result)
decimal * PGTYPESdecimal_new(void)
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
numeric * PGTYPESnumeric_from_asc(char *str, char **endptr)
struct sqlvar_struct sqlvar[1]
struct sqlda_struct * desc_next