Re: 7.3beta and ecpg

Поиск
Список
Период
Сортировка
От Michael Meskes
Тема Re: 7.3beta and ecpg
Дата
Msg-id 20020912145832.GA32179@feivel.credativ.de
обсуждение исходный текст
Ответ на Re: 7.3beta and ecpg  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: 7.3beta and ecpg  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Sep 12, 2002 at 09:07:20AM -0400, Tom Lane wrote:
> Michael Meskes <meskes@postgresql.org> writes:
> > I'm awfully sorry that I missed this thread. But I do not really
> > understand the problem. If we cannot be exactly as specified why aren't
> > we coming close? As it stands now I have to implement my own
> > PREPARE/EXECUTE in ecpg and the syntax does clash with the backend one.
> 
> But you must implement your own PREPARE/EXECUTE anyway, using ecpg
> variables, no?  If you can really embed what you need in the backend
> facility, and only the syntax variation is getting in the way, then
> maybe I misunderstand the problem.  How do parameters of PREPAREd
> statements work in ecpg?

In ecpg you can use a string variable or constant holding the statement
to prepare that statement as in 

exec sql prepare STMT from string;

This binds the ident STMT to the statement in string. Later you can then
declare a cursor using

exec sql declare CURS cursor for STMT;

or execute the statement using

exec sql execute STMT;

Now if you have a parameter in the prepared statement by just specify 
"?" instead some value, you add a using clause during execution to set
the values. 

I'm not sure where you expect the ecpg variables. If you're talking
about C variables they won't be seen by any statement since ecpg creates
an ascii string of the whole statement before sending it to the backend.

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: OPAQUE and 7.2-7.3 upgrade
Следующее
От: Philip Warner
Дата:
Сообщение: Re: OPAQUE and 7.2-7.3 upgrade