ecpg - problem compiling prepare and declare statements

Поиск
Список
Период
Сортировка
От Paul Tilles
Тема ecpg - problem compiling prepare and declare statements
Дата
Msg-id 3FF9A98D.A98A150A@noaa.gov
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Complex Update
Следующее
От: Rich Hall
Дата:
Сообщение: Re: Virtual records