ecpg - problem compiling prepare and declare statements

From: Paul Tilles <Paul(dot)Tilles(at)noaa(dot)gov>
To: pgsql-sql(at)postgresql(dot)org
Cc: Xiaobiao Fan <Xiaobiao(dot)Fan(at)noaa(dot)gov>, Paul Tilles <Paul(dot)Tilles(at)noaa(dot)gov>
Subject: ecpg - problem compiling prepare and declare statements
Date: 2004-01-05 18:14:37
Message-ID: 3FF9A98D.A98A150A@noaa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Using psql V7.4.1 and ecpg V3.1.0 on RH Linux 7.2, gcc compiler:

The following statement precompiles, compiles and links fine:

EXEC SQL declare state_cursor cursor for "select unique state from
location where post = 1";

I then change the above to

EXEC SQL BEGIN DECLARE SECTION;
const char *stmt="select unique state from location where post = 1";
EXEC SQL END DECLARE SECTION;

EXEC SQL declare state_cursor cursor for :stmt;

These statements generate the following warning from the gcc compiler:

warning: passing arg 3 of ECPGprepare discards qualifiers from pointer
target type

and the link fails.

What am I doing wrong?

TIA,
Paul Tilles

Browse pgsql-sql by date

  From Date Subject
Next Message Evan Klinger 2004-01-05 21:47:46 PostgreSQL Array Syntax
Previous Message teknokrat 2004-01-05 17:14:26 grouping by date