7 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
18 #ifndef _ECPG_SQL3TYPES_H
19 #define _ECPG_SQL3TYPES_H
66 #ifndef POSTGRES_SQLCA_H
67 #define POSTGRES_SQLCA_H
70 #if defined(WIN32) || defined(__CYGWIN__)
71 #define PGDLLIMPORT __declspec (dllimport)
77 #define SQLERRMC_LEN 150
123 #ifndef POSTGRES_ECPG_INTERNAL
124 #define sqlca (*ECPGget_sqlca())
133 #line 8 "dyntest.pgc"
136 #line 1 "regression.h"
143 #line 9 "dyntest.pgc"
168 #line 22 "dyntest.pgc"
171 #line 23 "dyntest.pgc"
174 #line 24 "dyntest.pgc"
177 #line 25 "dyntest.pgc"
180 #line 26 "dyntest.pgc"
181 int TYPE , LENGTH , OCTET_LENGTH , PRECISION , SCALE , RETURNED_OCTET_LENGTH ;
183 #line 27 "dyntest.pgc"
184 int DATETIME_INTERVAL_CODE ;
186 #line 28 "dyntest.pgc"
187 char NAME [ 120 ] , BOOLVAR ;
189 #line 29 "dyntest.pgc"
190 char STRINGVAR [ 1024 ] ;
192 #line 30 "dyntest.pgc"
195 #line 31 "dyntest.pgc"
198 #line 32 "dyntest.pgc"
203 #line 35 "dyntest.pgc"
208 QUERY =
"select * from dyntest";
211 #line 43 "dyntest.pgc"
215 #line 45 "dyntest.pgc"
218 #line 45 "dyntest.pgc"
221 {
ECPGconnect(__LINE__, 0,
"ecpg1_regression" , NULL, NULL , NULL, 0);
222 #line 47 "dyntest.pgc"
225 #line 47 "dyntest.pgc"
229 #line 49 "dyntest.pgc"
232 #line 49 "dyntest.pgc"
235 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"create table dyntest ( name char ( 14 ) , d float8 , i int , bignumber int8 , b boolean , comment text , day date )",
ECPGt_EOIT,
ECPGt_EORT);
236 #line 53 "dyntest.pgc"
239 #line 53 "dyntest.pgc"
241 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into dyntest values ( 'first entry' , 14.7 , 14 , 123045607890 , true , 'The world''s most advanced open source database.' , '1987-07-14' )",
ECPGt_EOIT,
ECPGt_EORT);
242 #line 54 "dyntest.pgc"
245 #line 54 "dyntest.pgc"
247 {
ECPGdo(__LINE__, 0, 1, NULL, 0,
ECPGst_normal,
"insert into dyntest values ( 'second entry' , 1407.87 , 1407 , 987065403210 , false , 'The elephant never forgets.' , '1999-11-5' )",
ECPGt_EOIT,
ECPGt_EORT);
248 #line 55 "dyntest.pgc"
251 #line 55 "dyntest.pgc"
254 {
ECPGprepare(__LINE__, NULL, 0,
"myquery", QUERY);
255 #line 57 "dyntest.pgc"
258 #line 57 "dyntest.pgc"
261 #line 58 "dyntest.pgc"
267 #line 60 "dyntest.pgc"
270 #line 60 "dyntest.pgc"
278 #line 64 "dyntest.pgc"
281 #line 64 "dyntest.pgc"
289 #line 69 "dyntest.pgc"
292 #line 69 "dyntest.pgc"
300 for (INDEX = 1; INDEX <=
COUNT; ++INDEX)
312 #line 86 "dyntest.pgc"
315 #line 86 "dyntest.pgc"
317 printf (
"%2d\t%s (type: %d length: %d precision: %d scale: %d = " , INDEX, NAME, TYPE, LENGTH, PRECISION, SCALE);
324 printf (
"numeric(%d,%d)", PRECISION, SCALE);
327 printf (
"decimal(%d,%d)", PRECISION, SCALE);
336 printf (
"float(%d,%d)", PRECISION, SCALE);
342 printf (
"double precision");
348 #line 116 "dyntest.pgc"
351 #line 116 "dyntest.pgc"
353 switch (DATETIME_INTERVAL_CODE)
365 printf (
"time with time zone");
368 printf (
"timestamp with time zone");
377 printf (
"char(%d)", LENGTH);
383 printf (
"varchar(%d)", LENGTH);
388 printf (
"<SQL3 %d>", TYPE);
391 printf (
")\n\toctet_length: %d returned_octet_length: %d)\n\t= ",
392 OCTET_LENGTH, RETURNED_OCTET_LENGTH);
402 #line 163 "dyntest.pgc"
405 #line 163 "dyntest.pgc"
407 printf (
"%s\n", BOOLVAR ?
"true" :
"false");
414 #line 168 "dyntest.pgc"
417 #line 168 "dyntest.pgc"
425 #line 172 "dyntest.pgc"
428 #line 172 "dyntest.pgc"
430 printf (
"%.*f\n", PRECISION, DOUBLEVAR);
437 #line 178 "dyntest.pgc"
440 #line 178 "dyntest.pgc"
442 printf (
"%d \"%s\"\n", DATETIME_INTERVAL_CODE, STRINGVAR);
449 #line 183 "dyntest.pgc"
452 #line 183 "dyntest.pgc"
454 printf (
"\"%s\"\n", STRINGVAR);
460 #line 187 "dyntest.pgc"
463 #line 187 "dyntest.pgc"
465 printf (
"<\"%s\">\n", STRINGVAR);
472 #line 194 "dyntest.pgc"
475 #line 194 "dyntest.pgc"
479 #line 196 "dyntest.pgc"
482 #line 196 "dyntest.pgc"
bool ECPGconnect(int lineno, int c, const char *name, const char *user, const char *passwd, const char *connection_name, int autocommit)
bool ECPGdeallocate_desc(int line, const char *name)
bool ECPGget_desc(int lineno, const char *desc_name, int index,...)
bool ECPGallocate_desc(int line, const char *name)
bool ECPGget_desc_header(int lineno, const char *desc_name, int *count)
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 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)
@ SQL3_DATE_TIME_TIMESTAMP
struct sqlca_t * ECPGget_sqlca(void)
@ SQL3_DDT_TIME_WITH_TIME_ZONE
@ SQL3_DDT_TIMESTAMP_WITH_TIME_ZONE
char sqlerrmc[SQLERRMC_LEN]
struct sqlca_t::@163 sqlerrm