/* Processed by ecpg (regression mode) */ /* These include files are added by the preprocessor */ #include <ecpglib.h> #include <ecpgerrno.h> #include <sqlca.h> /* End of automatic include section */ #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
struct sqlca_t
{ char sqlcaid[8]; long sqlabc; long sqlcode; struct
{ int sqlerrml; char sqlerrmc[SQLERRMC_LEN];
} sqlerrm; char sqlerrp[8]; long sqlerrd[6]; /* Element 0: empty */ /* 1: OID of processed tuple if applicable */ /* 2: number of rows processed */ /* after an INSERT, UPDATE or */ /* DELETE statement */ /* 3: empty */ /* 4: empty */ /* 5: empty */ char sqlwarn[8]; /* Element 0: set to 'W' if at least one other is 'W' */ /* 1: if 'W' at least one character string */ /* value was truncated when it was */ /* stored into a host variable. */
if (sqlca.sqlcode < 0) sqlprint();} #line75"array.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select f , text from test where i = 1", ECPGt_EOIT,
ECPGt_double,&(f),(long)1,(long)1,sizeof(double),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,(text),(long)25,(long)1,(25)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); #line80"array.pgc"
if (sqlca.sqlcode < 0) sqlprint();} #line80"array.pgc"
printf("Found f=%f text=%10.10s\n", f, text);
f=140787;
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select a , text , ts , n , d , inter from test where f = $1 ",
ECPGt_double,&(f),(long)1,(long)1,sizeof(double),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_short,(a),(long)1,(long)10,sizeof(short),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_char,&(t),(long)0,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_timestamp,&(ts),(long)1,(long)10,sizeof(timestamp),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_numeric,&(n),(long)1,(long)10,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_date,&(d),(long)1,(long)10,sizeof(date),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_interval,&(in),(long)1,(long)10,sizeof(interval),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); #line88"array.pgc"
if (sqlca.sqlcode < 0) sqlprint();} #line88"array.pgc"
for (i = 0; i < 10; i++)
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])));
printf("Found text=%10.10s\n", t);
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "select a from test where f = $1 ",
ECPGt_double,&(f),(long)1,(long)1,sizeof(double),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_char,(text),(long)25,(long)1,(25)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); #line98"array.pgc"
if (sqlca.sqlcode < 0) sqlprint();} #line98"array.pgc"
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.