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