Re: PQexecParams and CURSOR

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: PQexecParams and CURSOR
Дата
Msg-id 20050117152905.GA52887@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: PQexecParams and CURSOR  ("Laurent Marzullo" <laurent.marzullo@atosorigin.com>)
Ответы Re: PQexecParams and CURSOR  ("Laurent Marzullo" <laurent.marzullo@atosorigin.com>)
Список pgsql-general
On Mon, Jan 17, 2005 at 11:28:57AM +0100, Laurent Marzullo wrote:

>         // res = PQexec( conn , "FETCH 1 FROM MY_CURSOR" );

The above should work if you uncomment it and comment out or remove
the other two attempts to execute FETCH.

>         /*
>         res = PQexecParams(conn,
>                 "FETCH 1 FROM MY_CURSOR",
>                 0,
>                 NULL,
>                 NULL,
>                 NULL,
>                 NULL,
>                 0);
>         */

The above should also work if you uncomment it and comment out or
remove the other two.

>         res = PQexecParams(conn,
>                 "FETCH 1 FROM MY_CURSOR",
>                 1,
>                 NULL,
>                 paramValues,
>                 NULL,
>                 NULL,
>                 0);

This call fails because you're passing a parameter that the FETCH
statement doesn't need (you're passing 1 as the nParams argument
and the parameter list as paramValues).  Use one of the other two
methods, either PQexec() or PQexecParams() with nParams set to 0
and pass NULL instead of paramValues.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: "Mike G."
Дата:
Сообщение: Use strict with plperl
Следующее
От: Bo Lorentsen
Дата:
Сообщение: Re: Index optimization ?