Search Postgresql Archives

Re: PQexecParams and CURSOR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux