Re: Parameters.Refresh and RETURN setof TEXT - Mailing list pgsql-odbc

From Hiroshi Inoue
Subject Re: Parameters.Refresh and RETURN setof TEXT
Date
Msg-id 44E71019.9080704@tpf.co.jp
Whole thread Raw
In response to Parameters.Refresh and RETURN setof TEXT  ("Rodney Franks" <rodney@careerjunction.co.za>)
List pgsql-odbc
Rodney Franks wrote:
> Hi all,
> If I have a simple set returning function like 'aafunc1'
> ----------------------------------------------------------------
>
> CREATE OR REPLACE FUNCTION "public"."aafunc1" (v_acc integer) RETURNS SETOF text AS
> $body$
> BEGIN
>      RETURN NEXT 'Arbitary_string of unlimitedLength.';
>      RETURN NEXT 'Arbitary_string of unlimitedLength222222.';
> RETURN;
> END;
> $body$
> LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
> ----------------------------------------------------------------
>
> Which I then call using vbsrcipt, ADO & the postgresql odbc driver like this:-
>
> ----------------------------------------------------------------
>     Set oCmd = CreateObject("ADODB.Command")
>     With oCmd
>             .ActiveConnection = oConnection
>             .CommandType = 4 'adCmdStoredProc
>               .CommandText = "public.aafunc1"
>             .Parameters.Refresh()
>             .Parameters("v_acc").Value = 1
>             .Execute
>       End With
>       wscript.echo oCmd.Parameters(0)
> ----------------------------------------------------------------
>
> Why does it not work, it returns an error ...
> errmsg='ERROR: set-valued function called in context that cannot accept a set'
>

Hi Rodney,
Could you try the dll at
  http://www.geocities.jp/inocchichichi/psqlodbc/index.html . ?

regards,
Hiroshi Inoue

pgsql-odbc by date:

Previous
From:
Date:
Subject: [ psqlodbc-Bugs-1000710 ] CHAR field of resultset contains garbled data
Next
From:
Date:
Subject: [ psqlodbc-Bugs-1000708 ] SQLPrimaryKeys missing PK_NAME is NULL