ecpg incompatibility with DB2

From: John Summerfield <pgtest(at)os2(dot)ami(dot)com(dot)au>
To: <meskes(at)debian(dot)org>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: ecpg incompatibility with DB2
Date: 2001-09-09 13:01:36
Message-ID: Pine.LNX.4.33.0109092049330.29206-100000@possum.os2.ami.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-09-09 14:58:04 Bug #445: SQLDescribeCol() returns "wrong" info
Previous Message pgsql-bugs 2001-09-09 12:50:50 Bug #444: create table xy as select a, b from t_a left join t_b on cond fails in PL/pgSQL