Re: [GENERAL] CURSORs and selects with parameters

2005-02-15 Thread Dan Sugalski
At 12:50 PM -0700 2/15/05, Michael Fuhr wrote: On Tue, Feb 15, 2005 at 02:32:56PM -0500, Dan Sugalski wrote: I've got some code that uses PQexecParams and does the equivalent of: DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1 FETCH NEXT a_cursor but when I get to th

Re: [GENERAL] CURSORs and selects with parameters

2005-02-15 Thread Michael Fuhr
On Tue, Feb 15, 2005 at 02:32:56PM -0500, Dan Sugalski wrote: > > I've got some code that uses PQexecParams and does the equivalent of: > >DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1 >FETCH NEXT a_cursor > > but when I get to the FETCH I'm getting back the error

[GENERAL] CURSORs and selects with parameters

2005-02-15 Thread Dan Sugalski
When using cursors through the libpq interface, do I need to be passing in the parameters when I'm FETCHing from them? I've got some code that uses PQexecParams and does the equivalent of: DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1 FETCH NEXT a_cursor but when I g