ecpg incompatibility with DB2
| От | John Summerfield |
|---|---|
| Тема | ecpg incompatibility with DB2 |
| Дата | |
| Msg-id | Pine.LNX.4.33.0109092049330.29206-100000@possum.os2.ami.com.au обсуждение исходный текст |
| Список | pgsql-bugs |
This is explicity allowed in db2:
void f3(int i)
{
EXEC SQL BEGIN DECLARE SECTION;
char host_var_3[25];
EXEC SQL END DECLARE SECTION;
EXEC SQL SELECT COL2 INTO :host_var_3 FROM TBL2;
}
void f4(int i)
{
char host_var_3[25];
EXEC SQL INSERT INTO TBL2 VALUES (:host_var_3);
}
In db2 host variable definitions are global. You can have more than one
corresponding host variable with the proviso that they are of the same
type and size.
In ecpg I tried to use this definition:
exec sql begin declare section;
char date[9];
long time;
char ASXcode[7];
int thigh;
int tlow;
int tclose;
int topen;
int tvolume;
unsigned long long tvalue;
exec sql end declare section;
function ()
char date[9];
{
exec sql ... :date ...;
}
which is required in DB2 (in order to use the same host variable name) but
ecpg does not allow.
The construct that ecpg requires is not legal in DB2.
В списке pgsql-bugs по дате отправления: