Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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.





pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group