ecpg - problem compiling prepare and declare statements - Mailing list pgsql-sql

From Paul Tilles
Subject ecpg - problem compiling prepare and declare statements
Date
Msg-id 3FF9A98D.A98A150A@noaa.gov
Whole thread Raw
List 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



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Complex Update
Next
From: Rich Hall
Date:
Subject: Re: Virtual records