On Fri, Sep 11, 2009 at 12:31 AM, Ehsan Haq <ehsan_haq98@yahoo.com> wrote:
>
> Hi,
> I am looking for a way to get the OUT parameters of a FUNCTION/PROCEDURE in my application (C++) using C libpq
library.I can get the result set of an OUT parameter having REFCURSOR data type through an explicit FETCH ALL from
"YYYY"but for OUT parameter of type integer/varchar I dont have a clue. Can anyone tell me how it is done or suggest
anywork around for this?
name your cursor: also, remember that your cursor is only good for
duration of transaction.
> Using the following code I can get the refcursor.
>
> CREATE OR REPLACE
> Function getAddresses
> (
> pName IN varchar2, outCursor refcursor
outCursor := 'outcur';
[...]
FETCH all FROM outcur;
see:
http://www.postgresql.org/docs/8.4/interactive/plpgsql-cursors.html#PLPGSQL-CURSOR-USING
merlin