ECPG question about PREPARE and EXECUTE

Поиск
Список
Период
Сортировка
От Boszormenyi Zoltan
Тема ECPG question about PREPARE and EXECUTE
Дата
Msg-id 4CDA77A4.3050407@cybertec.at
обсуждение исходный текст
Ответы Re: ECPG question about PREPARE and EXECUTE  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-hackers
Hi,

a question came to us in the form of a code example,
which I shortened. Say, we have this structure:

============================
EXEC SQL BEGIN DECLARE SECTION;

struct t1 {       int     id;       char    t[80];
};
typedef struct t1 t1_t;

t1_t    t1;
EXEC SQL END DECLARE SECTION;
============================

and a similar table in the database. The client wanted
to use a PREPARE / EXECUTE pair this way:

============================
EXEC SQL PREPARE myquery AS
SELECT * FROM t1 WHERE id = :t1.id;

t1.id = 1;

EXEC SQL EXECUTE myquery INTO :t1;
============================

Upon executing the EXECUTE query, we get an error:

SQL error: too few arguments on line NNN

The problem is that the input parameters given to the
PREPARE are not preserved and carried to the EXECUTE.

Any comment on why it isn't done?

Best regards,
Zoltán Böszörményi

-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de    http://www.postgresql.at/



В списке pgsql-hackers по дате отправления:

Предыдущее
От: tomas@tuxteam.de
Дата:
Сообщение: Re: W3C Specs: Web SQL
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Don't unblock SIGQUIT in the SIGQUIT handler This was possibly