Commit 858dc6dc authored by Michael Meskes's avatar Michael Meskes

Removed more inttypes.h stuff.

parent ee0b6024
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h> #include <limits.h>
exec sql include ../regression; exec sql include ../regression;
...@@ -36,9 +36,6 @@ dump_sqlda(sqlda_t *sqlda) ...@@ -36,9 +36,6 @@ dump_sqlda(sqlda_t *sqlda)
case SQLINT: case SQLINT:
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata);
break; break;
case SQLINT8:
printf("name sqlda descriptor: '%s' value %" PRId64 "\n", sqlda->sqlvar[i].sqlname, *(int64_t *)sqlda->sqlvar[i].sqldata);
break;
case SQLFLOAT: case SQLFLOAT:
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata);
break; break;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#line 1 "sqlda.pgc" #line 1 "sqlda.pgc"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h> #include <limits.h>
#line 1 "regression.h" #line 1 "regression.h"
...@@ -141,9 +141,6 @@ dump_sqlda(sqlda_t *sqlda) ...@@ -141,9 +141,6 @@ dump_sqlda(sqlda_t *sqlda)
case SQLINT: case SQLINT:
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname, *(int *)sqlda->sqlvar[i].sqldata);
break; break;
case SQLINT8:
printf("name sqlda descriptor: '%s' value %" PRId64 "\n", sqlda->sqlvar[i].sqlname, *(int64_t *)sqlda->sqlvar[i].sqldata);
break;
case SQLFLOAT: case SQLFLOAT:
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname, *(double *)sqlda->sqlvar[i].sqldata);
break; break;
...@@ -167,19 +164,19 @@ main (void) ...@@ -167,19 +164,19 @@ main (void)
#line 60 "sqlda.pgc" #line 57 "sqlda.pgc"
char * stmt1 = "SELECT * FROM t1" ; char * stmt1 = "SELECT * FROM t1" ;
#line 61 "sqlda.pgc" #line 58 "sqlda.pgc"
char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ; char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ;
#line 62 "sqlda.pgc" #line 59 "sqlda.pgc"
int rec ; int rec ;
#line 63 "sqlda.pgc" #line 60 "sqlda.pgc"
int id ; int id ;
/* exec sql end declare section */ /* exec sql end declare section */
#line 64 "sqlda.pgc" #line 61 "sqlda.pgc"
char msg[128]; char msg[128];
...@@ -188,42 +185,42 @@ main (void) ...@@ -188,42 +185,42 @@ main (void)
strcpy(msg, "connect"); strcpy(msg, "connect");
{ ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "regress1", 0); { ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "regress1", 0);
#line 71 "sqlda.pgc" #line 68 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 71 "sqlda.pgc" #line 68 "sqlda.pgc"
strcpy(msg, "set"); strcpy(msg, "set");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
#line 74 "sqlda.pgc" #line 71 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 74 "sqlda.pgc" #line 71 "sqlda.pgc"
strcpy(msg, "create"); strcpy(msg, "create");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) )", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) )", ECPGt_EOIT, ECPGt_EORT);
#line 82 "sqlda.pgc" #line 79 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 82 "sqlda.pgc" #line 79 "sqlda.pgc"
strcpy(msg, "insert"); strcpy(msg, "insert");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '\"c\"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' )", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '\"c\"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' )", ECPGt_EOIT, ECPGt_EORT);
#line 89 "sqlda.pgc" #line 86 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 89 "sqlda.pgc" #line 86 "sqlda.pgc"
strcpy(msg, "commit"); strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit"); { ECPGtrans(__LINE__, NULL, "commit");
#line 92 "sqlda.pgc" #line 89 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 92 "sqlda.pgc" #line 89 "sqlda.pgc"
/* SQLDA test for getting all records from a table */ /* SQLDA test for getting all records from a table */
...@@ -232,29 +229,29 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -232,29 +229,29 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1); { ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1);
#line 99 "sqlda.pgc" #line 96 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 99 "sqlda.pgc" #line 96 "sqlda.pgc"
strcpy(msg, "declare"); strcpy(msg, "declare");
ECPG_informix_reset_sqlca(); /* declare mycur1 cursor for $1 */ ECPG_informix_reset_sqlca(); /* declare mycur1 cursor for $1 */
#line 102 "sqlda.pgc" #line 99 "sqlda.pgc"
strcpy(msg, "open"); strcpy(msg, "open");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1", { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1",
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 105 "sqlda.pgc" #line 102 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 105 "sqlda.pgc" #line 102 "sqlda.pgc"
/* exec sql whenever not found break ; */ /* exec sql whenever not found break ; */
#line 107 "sqlda.pgc" #line 104 "sqlda.pgc"
rec = 0; rec = 0;
...@@ -264,13 +261,13 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -264,13 +261,13 @@ if (sqlca.sqlcode < 0) exit (1);}
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT, { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 113 "sqlda.pgc" #line 110 "sqlda.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) break; if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
#line 113 "sqlda.pgc" #line 110 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 113 "sqlda.pgc" #line 110 "sqlda.pgc"
printf("FETCH RECORD %d\n", ++rec); printf("FETCH RECORD %d\n", ++rec);
...@@ -278,23 +275,23 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -278,23 +275,23 @@ if (sqlca.sqlcode < 0) exit (1);}
} }
/* exec sql whenever not found continue ; */ /* exec sql whenever not found continue ; */
#line 119 "sqlda.pgc" #line 116 "sqlda.pgc"
strcpy(msg, "close"); strcpy(msg, "close");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
#line 122 "sqlda.pgc" #line 119 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 122 "sqlda.pgc" #line 119 "sqlda.pgc"
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id1"); { ECPGdeallocate(__LINE__, 1, NULL, "st_id1");
#line 125 "sqlda.pgc" #line 122 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 125 "sqlda.pgc" #line 122 "sqlda.pgc"
free(outp_sqlda); free(outp_sqlda);
...@@ -307,29 +304,29 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -307,29 +304,29 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1); { ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1);
#line 136 "sqlda.pgc" #line 133 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 136 "sqlda.pgc" #line 133 "sqlda.pgc"
strcpy(msg, "declare"); strcpy(msg, "declare");
ECPG_informix_reset_sqlca(); /* declare mycur2 cursor for $1 */ ECPG_informix_reset_sqlca(); /* declare mycur2 cursor for $1 */
#line 139 "sqlda.pgc" #line 136 "sqlda.pgc"
strcpy(msg, "open"); strcpy(msg, "open");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1", { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1",
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 142 "sqlda.pgc" #line 139 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 142 "sqlda.pgc" #line 139 "sqlda.pgc"
/* exec sql whenever not found break ; */ /* exec sql whenever not found break ; */
#line 144 "sqlda.pgc" #line 141 "sqlda.pgc"
rec = 0; rec = 0;
...@@ -339,13 +336,13 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -339,13 +336,13 @@ if (sqlca.sqlcode < 0) exit (1);}
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch from mycur2", ECPGt_EOIT, { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "fetch from mycur2", ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 150 "sqlda.pgc" #line 147 "sqlda.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) break; if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
#line 150 "sqlda.pgc" #line 147 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 150 "sqlda.pgc" #line 147 "sqlda.pgc"
printf("FETCH RECORD %d\n", ++rec); printf("FETCH RECORD %d\n", ++rec);
...@@ -353,23 +350,23 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -353,23 +350,23 @@ if (sqlca.sqlcode < 0) exit (1);}
} }
/* exec sql whenever not found continue ; */ /* exec sql whenever not found continue ; */
#line 156 "sqlda.pgc" #line 153 "sqlda.pgc"
strcpy(msg, "close"); strcpy(msg, "close");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
#line 159 "sqlda.pgc" #line 156 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 159 "sqlda.pgc" #line 156 "sqlda.pgc"
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id2"); { ECPGdeallocate(__LINE__, 1, NULL, "st_id2");
#line 162 "sqlda.pgc" #line 159 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 162 "sqlda.pgc" #line 159 "sqlda.pgc"
free(outp_sqlda); free(outp_sqlda);
...@@ -394,10 +391,10 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -394,10 +391,10 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2); { ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2);
#line 185 "sqlda.pgc" #line 182 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 185 "sqlda.pgc" #line 182 "sqlda.pgc"
strcpy(msg, "execute"); strcpy(msg, "execute");
...@@ -406,20 +403,20 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -406,20 +403,20 @@ if (sqlca.sqlcode < 0) exit (1);}
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 188 "sqlda.pgc" #line 185 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 188 "sqlda.pgc" #line 185 "sqlda.pgc"
dump_sqlda(outp_sqlda); dump_sqlda(outp_sqlda);
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id3"); { ECPGdeallocate(__LINE__, 1, NULL, "st_id3");
#line 193 "sqlda.pgc" #line 190 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 193 "sqlda.pgc" #line 190 "sqlda.pgc"
free(inp_sqlda->sqlvar); free(inp_sqlda->sqlvar);
...@@ -431,10 +428,10 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -431,10 +428,10 @@ if (sqlca.sqlcode < 0) exit (1);}
*/ */
{ ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "con2", 0); { ECPGconnect(__LINE__, 1, "regress1" , NULL, NULL , "con2", 0);
#line 203 "sqlda.pgc" #line 200 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 203 "sqlda.pgc" #line 200 "sqlda.pgc"
/* Input sqlda has to be built manually */ /* Input sqlda has to be built manually */
...@@ -455,10 +452,10 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -455,10 +452,10 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2); { ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2);
#line 222 "sqlda.pgc" #line 219 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 222 "sqlda.pgc" #line 219 "sqlda.pgc"
strcpy(msg, "execute"); strcpy(msg, "execute");
...@@ -467,28 +464,28 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -467,28 +464,28 @@ if (sqlca.sqlcode < 0) exit (1);}
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 225 "sqlda.pgc" #line 222 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 225 "sqlda.pgc" #line 222 "sqlda.pgc"
dump_sqlda(outp_sqlda); dump_sqlda(outp_sqlda);
strcpy(msg, "commit"); strcpy(msg, "commit");
{ ECPGtrans(__LINE__, "con2", "commit"); { ECPGtrans(__LINE__, "con2", "commit");
#line 230 "sqlda.pgc" #line 227 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 230 "sqlda.pgc" #line 227 "sqlda.pgc"
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 1, NULL, "st_id4"); { ECPGdeallocate(__LINE__, 1, NULL, "st_id4");
#line 233 "sqlda.pgc" #line 230 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 233 "sqlda.pgc" #line 230 "sqlda.pgc"
free(inp_sqlda->sqlvar); free(inp_sqlda->sqlvar);
...@@ -497,36 +494,36 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -497,36 +494,36 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "disconnect"); strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "con2"); { ECPGdisconnect(__LINE__, "con2");
#line 240 "sqlda.pgc" #line 237 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 240 "sqlda.pgc" #line 237 "sqlda.pgc"
/* End test */ /* End test */
strcpy(msg, "drop"); strcpy(msg, "drop");
{ ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 1, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT);
#line 245 "sqlda.pgc" #line 242 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 245 "sqlda.pgc" #line 242 "sqlda.pgc"
strcpy(msg, "commit"); strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit"); { ECPGtrans(__LINE__, NULL, "commit");
#line 248 "sqlda.pgc" #line 245 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 248 "sqlda.pgc" #line 245 "sqlda.pgc"
strcpy(msg, "disconnect"); strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT"); { ECPGdisconnect(__LINE__, "CURRENT");
#line 251 "sqlda.pgc" #line 248 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 251 "sqlda.pgc" #line 248 "sqlda.pgc"
return (0); return (0);
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#line 1 "sqlda.pgc" #line 1 "sqlda.pgc"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include <limits.h> #include <limits.h>
...@@ -20,7 +19,7 @@ ...@@ -20,7 +19,7 @@
#line 6 "sqlda.pgc" #line 5 "sqlda.pgc"
...@@ -44,7 +43,7 @@ typedef struct sqlda_struct sqlda_t; ...@@ -44,7 +43,7 @@ typedef struct sqlda_struct sqlda_t;
#endif /* ECPG_SQLDA_H */ #endif /* ECPG_SQLDA_H */
#line 8 "sqlda.pgc" #line 7 "sqlda.pgc"
#line 1 "pgtypes_numeric.h" #line 1 "pgtypes_numeric.h"
...@@ -115,11 +114,11 @@ int PGTYPESnumeric_from_decimal(decimal *, numeric *); ...@@ -115,11 +114,11 @@ int PGTYPESnumeric_from_decimal(decimal *, numeric *);
#endif /* PGTYPES_NUMERIC */ #endif /* PGTYPES_NUMERIC */
#line 9 "sqlda.pgc" #line 8 "sqlda.pgc"
/* exec sql whenever sqlerror stop ; */ /* exec sql whenever sqlerror stop ; */
#line 11 "sqlda.pgc" #line 10 "sqlda.pgc"
/* These shouldn't be under DECLARE SECTION */ /* These shouldn't be under DECLARE SECTION */
...@@ -149,13 +148,6 @@ dump_sqlda(sqlda_t *sqlda) ...@@ -149,13 +148,6 @@ dump_sqlda(sqlda_t *sqlda)
case ECPGt_int: case ECPGt_int:
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname.data, *(int *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname.data, *(int *)sqlda->sqlvar[i].sqldata);
break; break;
#ifdef HAVE_LONG_LONG_INT_64
case ECPGt_long_long:
#else
case ECPGt_long:
#endif
printf("name sqlda descriptor: '%s' value " INT64_FORMAT "\n", sqlda->sqlvar[i].sqlname.data, *(int64_t *)sqlda->sqlvar[i].sqldata);
break;
case ECPGt_double: case ECPGt_double:
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata);
break; break;
...@@ -181,19 +173,19 @@ main (void) ...@@ -181,19 +173,19 @@ main (void)
#line 67 "sqlda.pgc" #line 59 "sqlda.pgc"
char * stmt1 = "SELECT * FROM t1" ; char * stmt1 = "SELECT * FROM t1" ;
#line 68 "sqlda.pgc" #line 60 "sqlda.pgc"
char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ; char * stmt2 = "SELECT * FROM t1 WHERE id = ?" ;
#line 69 "sqlda.pgc" #line 61 "sqlda.pgc"
int rec ; int rec ;
#line 70 "sqlda.pgc" #line 62 "sqlda.pgc"
int id ; int id ;
/* exec sql end declare section */ /* exec sql end declare section */
#line 71 "sqlda.pgc" #line 63 "sqlda.pgc"
char msg[128]; char msg[128];
...@@ -202,42 +194,42 @@ main (void) ...@@ -202,42 +194,42 @@ main (void)
strcpy(msg, "connect"); strcpy(msg, "connect");
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "regress1", 0); { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "regress1", 0);
#line 78 "sqlda.pgc" #line 70 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 78 "sqlda.pgc" #line 70 "sqlda.pgc"
strcpy(msg, "set"); strcpy(msg, "set");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "set datestyle to iso", ECPGt_EOIT, ECPGt_EORT);
#line 81 "sqlda.pgc" #line 73 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 81 "sqlda.pgc" #line 73 "sqlda.pgc"
strcpy(msg, "create"); strcpy(msg, "create");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) )", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table t1 ( id integer , t text , d1 numeric , d2 float8 , c char ( 10 ) )", ECPGt_EOIT, ECPGt_EORT);
#line 89 "sqlda.pgc" #line 81 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 89 "sqlda.pgc" #line 81 "sqlda.pgc"
strcpy(msg, "insert"); strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '\"c\"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' )", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into t1 values ( 1 , 'a' , 1.0 , 1 , 'a' ) , ( 2 , null , null , null , null ) , ( 3 , '\"c\"' , - 3 , 'nan' :: float8 , 'c' ) , ( 4 , 'd' , 4.0 , 4 , 'd' )", ECPGt_EOIT, ECPGt_EORT);
#line 96 "sqlda.pgc" #line 88 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 96 "sqlda.pgc" #line 88 "sqlda.pgc"
strcpy(msg, "commit"); strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit"); { ECPGtrans(__LINE__, NULL, "commit");
#line 99 "sqlda.pgc" #line 91 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 99 "sqlda.pgc" #line 91 "sqlda.pgc"
/* SQLDA test for getting all records from a table */ /* SQLDA test for getting all records from a table */
...@@ -246,29 +238,29 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -246,29 +238,29 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1); { ECPGprepare(__LINE__, NULL, 0, "st_id1", stmt1);
#line 106 "sqlda.pgc" #line 98 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 106 "sqlda.pgc" #line 98 "sqlda.pgc"
strcpy(msg, "declare"); strcpy(msg, "declare");
/* declare mycur1 cursor for $1 */ /* declare mycur1 cursor for $1 */
#line 109 "sqlda.pgc" #line 101 "sqlda.pgc"
strcpy(msg, "open"); strcpy(msg, "open");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1", { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur1 cursor for $1",
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id1", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 112 "sqlda.pgc" #line 104 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 112 "sqlda.pgc" #line 104 "sqlda.pgc"
/* exec sql whenever not found break ; */ /* exec sql whenever not found break ; */
#line 114 "sqlda.pgc" #line 106 "sqlda.pgc"
rec = 0; rec = 0;
...@@ -278,13 +270,13 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -278,13 +270,13 @@ if (sqlca.sqlcode < 0) exit (1);}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch 1 from mycur1", ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 120 "sqlda.pgc" #line 112 "sqlda.pgc"
if (sqlca.sqlcode == ECPG_NOT_FOUND) break; if (sqlca.sqlcode == ECPG_NOT_FOUND) break;
#line 120 "sqlda.pgc" #line 112 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 120 "sqlda.pgc" #line 112 "sqlda.pgc"
printf("FETCH RECORD %d\n", ++rec); printf("FETCH RECORD %d\n", ++rec);
...@@ -292,23 +284,23 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -292,23 +284,23 @@ if (sqlca.sqlcode < 0) exit (1);}
} }
/* exec sql whenever not found continue ; */ /* exec sql whenever not found continue ; */
#line 126 "sqlda.pgc" #line 118 "sqlda.pgc"
strcpy(msg, "close"); strcpy(msg, "close");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur1", ECPGt_EOIT, ECPGt_EORT);
#line 129 "sqlda.pgc" #line 121 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 129 "sqlda.pgc" #line 121 "sqlda.pgc"
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id1"); { ECPGdeallocate(__LINE__, 0, NULL, "st_id1");
#line 132 "sqlda.pgc" #line 124 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 132 "sqlda.pgc" #line 124 "sqlda.pgc"
free(outp_sqlda); free(outp_sqlda);
...@@ -319,35 +311,35 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -319,35 +311,35 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1); { ECPGprepare(__LINE__, NULL, 0, "st_id2", stmt1);
#line 141 "sqlda.pgc" #line 133 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 141 "sqlda.pgc" #line 133 "sqlda.pgc"
strcpy(msg, "declare"); strcpy(msg, "declare");
/* declare mycur2 cursor for $1 */ /* declare mycur2 cursor for $1 */
#line 144 "sqlda.pgc" #line 136 "sqlda.pgc"
strcpy(msg, "open"); strcpy(msg, "open");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1", { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare mycur2 cursor for $1",
ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char), ECPGt_char_variable,(ECPGprepared_statement(NULL, "st_id2", __LINE__)),(long)1,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 147 "sqlda.pgc" #line 139 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 147 "sqlda.pgc" #line 139 "sqlda.pgc"
strcpy(msg, "fetch"); strcpy(msg, "fetch");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch all from mycur2", ECPGt_EOIT, { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch all from mycur2", ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 150 "sqlda.pgc" #line 142 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 150 "sqlda.pgc" #line 142 "sqlda.pgc"
outp_sqlda1 = outp_sqlda; outp_sqlda1 = outp_sqlda;
...@@ -365,18 +357,18 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -365,18 +357,18 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "close"); strcpy(msg, "close");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close mycur2", ECPGt_EOIT, ECPGt_EORT);
#line 166 "sqlda.pgc" #line 158 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 166 "sqlda.pgc" #line 158 "sqlda.pgc"
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id2"); { ECPGdeallocate(__LINE__, 0, NULL, "st_id2");
#line 169 "sqlda.pgc" #line 161 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 169 "sqlda.pgc" #line 161 "sqlda.pgc"
/* SQLDA test for getting one record using an input descriptor */ /* SQLDA test for getting one record using an input descriptor */
...@@ -400,10 +392,10 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -400,10 +392,10 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2); { ECPGprepare(__LINE__, NULL, 0, "st_id3", stmt2);
#line 191 "sqlda.pgc" #line 183 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 191 "sqlda.pgc" #line 183 "sqlda.pgc"
strcpy(msg, "execute"); strcpy(msg, "execute");
...@@ -412,20 +404,20 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -412,20 +404,20 @@ if (sqlca.sqlcode < 0) exit (1);}
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 194 "sqlda.pgc" #line 186 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 194 "sqlda.pgc" #line 186 "sqlda.pgc"
dump_sqlda(outp_sqlda); dump_sqlda(outp_sqlda);
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id3"); { ECPGdeallocate(__LINE__, 0, NULL, "st_id3");
#line 199 "sqlda.pgc" #line 191 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 199 "sqlda.pgc" #line 191 "sqlda.pgc"
free(inp_sqlda); free(inp_sqlda);
...@@ -436,10 +428,10 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -436,10 +428,10 @@ if (sqlca.sqlcode < 0) exit (1);}
*/ */
{ ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "con2", 0); { ECPGconnect(__LINE__, 0, "regress1" , NULL, NULL , "con2", 0);
#line 208 "sqlda.pgc" #line 200 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 208 "sqlda.pgc" #line 200 "sqlda.pgc"
/* /*
...@@ -461,10 +453,10 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -461,10 +453,10 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "prepare"); strcpy(msg, "prepare");
{ ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2); { ECPGprepare(__LINE__, "con2", 0, "st_id4", stmt2);
#line 228 "sqlda.pgc" #line 220 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 228 "sqlda.pgc" #line 220 "sqlda.pgc"
strcpy(msg, "execute"); strcpy(msg, "execute");
...@@ -473,28 +465,28 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -473,28 +465,28 @@ if (sqlca.sqlcode < 0) exit (1);}
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT,
ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L, ECPGt_sqlda, &outp_sqlda, 0L, 0L, 0L,
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT); ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);
#line 231 "sqlda.pgc" #line 223 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 231 "sqlda.pgc" #line 223 "sqlda.pgc"
dump_sqlda(outp_sqlda); dump_sqlda(outp_sqlda);
strcpy(msg, "commit"); strcpy(msg, "commit");
{ ECPGtrans(__LINE__, "con2", "commit"); { ECPGtrans(__LINE__, "con2", "commit");
#line 236 "sqlda.pgc" #line 228 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 236 "sqlda.pgc" #line 228 "sqlda.pgc"
strcpy(msg, "deallocate"); strcpy(msg, "deallocate");
{ ECPGdeallocate(__LINE__, 0, NULL, "st_id4"); { ECPGdeallocate(__LINE__, 0, NULL, "st_id4");
#line 239 "sqlda.pgc" #line 231 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 239 "sqlda.pgc" #line 231 "sqlda.pgc"
free(inp_sqlda); free(inp_sqlda);
...@@ -502,36 +494,36 @@ if (sqlca.sqlcode < 0) exit (1);} ...@@ -502,36 +494,36 @@ if (sqlca.sqlcode < 0) exit (1);}
strcpy(msg, "disconnect"); strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "con2"); { ECPGdisconnect(__LINE__, "con2");
#line 245 "sqlda.pgc" #line 237 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 245 "sqlda.pgc" #line 237 "sqlda.pgc"
/* End test */ /* End test */
strcpy(msg, "drop"); strcpy(msg, "drop");
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT); { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "drop table t1", ECPGt_EOIT, ECPGt_EORT);
#line 250 "sqlda.pgc" #line 242 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 250 "sqlda.pgc" #line 242 "sqlda.pgc"
strcpy(msg, "commit"); strcpy(msg, "commit");
{ ECPGtrans(__LINE__, NULL, "commit"); { ECPGtrans(__LINE__, NULL, "commit");
#line 253 "sqlda.pgc" #line 245 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 253 "sqlda.pgc" #line 245 "sqlda.pgc"
strcpy(msg, "disconnect"); strcpy(msg, "disconnect");
{ ECPGdisconnect(__LINE__, "CURRENT"); { ECPGdisconnect(__LINE__, "CURRENT");
#line 256 "sqlda.pgc" #line 248 "sqlda.pgc"
if (sqlca.sqlcode < 0) exit (1);} if (sqlca.sqlcode < 0) exit (1);}
#line 256 "sqlda.pgc" #line 248 "sqlda.pgc"
return (0); return (0);
......
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include <limits.h> #include <limits.h>
exec sql include ../regression; exec sql include ../regression;
...@@ -37,13 +36,6 @@ dump_sqlda(sqlda_t *sqlda) ...@@ -37,13 +36,6 @@ dump_sqlda(sqlda_t *sqlda)
case ECPGt_int: case ECPGt_int:
printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname.data, *(int *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %d\n", sqlda->sqlvar[i].sqlname.data, *(int *)sqlda->sqlvar[i].sqldata);
break; break;
#ifdef HAVE_LONG_LONG_INT_64
case ECPGt_long_long:
#else
case ECPGt_long:
#endif
printf("name sqlda descriptor: '%s' value " INT64_FORMAT "\n", sqlda->sqlvar[i].sqlname.data, *(int64_t *)sqlda->sqlvar[i].sqldata);
break;
case ECPGt_double: case ECPGt_double:
printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata); printf("name sqlda descriptor: '%s' value %lf\n", sqlda->sqlvar[i].sqlname.data, *(double *)sqlda->sqlvar[i].sqldata);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment