127 short a [ 10 ] = { 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , 0 } ;
142 char text [ 25 ] =
"klmnopqrst" ;
145 char * t = (
char * )
malloc ( 11 ) ;
153 strcpy(t,
"0123456789");
158 for (
j = 0;
j < 10;
j++) {
175 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
189 {
ECPGtrans(__LINE__, NULL,
"begin work");
196 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table test ( f float , i int , a int [ 10 ] , text char ( 10 ) , ts timestamp [ 10 ] , n numeric [ 10 ] , d date [ 10 ] , inter interval [ 10 ] )",
ECPGt_EOIT,
ECPGt_EORT);
203 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into test ( f , i , a , text , ts , n , d , inter ) values ( 404.90 , 3 , '{0,1,2,3,4,5,6,7,8,9}' , 'abcdefghij' , $1 , $2 , $3 , $4 )",
218 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into test ( f , i , a , text , ts , n , d , inter ) values ( 140787.0 , 2 , $1 , $2 , $3 , $4 , $5 , $6 )",
237 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into test ( f , i , a , text , ts , n , d , inter ) values ( 14.07 , $1 , $2 , $3 , $4 , $5 , $6 , $7 )",
238 ECPGt_int,&(did),(
long)1,(
long)0,
sizeof(
int),
242 ECPGt_char,&(t),(
long)0,(
long)1,(1)*
sizeof(
char),
265 for (
j = 0;
j < 10;
j++) {
271 {
ECPGtrans(__LINE__, NULL,
"begin work");
292 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"select a , text , ts , n , d , inter from test where f = $1 ",
297 ECPGt_char,&(t),(
long)0,(
long)1,(1)*
sizeof(
char),
313 for (
i = 0;
i < 10;
i++)
314 printf(
"Found a[%d] = %d ts[%d] = %s n[%d] = %s d[%d] = %s in[%d] = %s\n",
i,
a[
i],
i,
PGTYPEStimestamp_to_asc(ts[
i]),
i,
PGTYPESnumeric_to_asc(&(n[
i]), -1),
i,
PGTYPESdate_to_asc(d[
i]),
i,
PGTYPESinterval_to_asc(&(in[
i])));
316 printf(
"Found text=%10.10s\n", t);
332 #line 102 "array.pgc"
335 #line 102 "array.pgc"
339 #line 104 "array.pgc"
342 #line 104 "array.pgc"
346 #line 106 "array.pgc"
349 #line 106 "array.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)
date PGTYPESdate_from_asc(char *str, char **endptr)
char * PGTYPESdate_to_asc(date dDate)
char * PGTYPESinterval_to_asc(interval *span)
interval * PGTYPESinterval_new(void)
interval * PGTYPESinterval_from_asc(char *str, char **endptr)
char * PGTYPESnumeric_to_asc(numeric *num, int dscale)
numeric * PGTYPESnumeric_new(void)
int PGTYPESnumeric_from_int(signed int int_val, numeric *var)
timestamp PGTYPEStimestamp_from_asc(char *str, char **endptr)
char * PGTYPEStimestamp_to_asc(timestamp tstamp)