Re: Parameters.Refresh and RETURN setof TEXT

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: rodney(at)careerjunction(dot)co(dot)za
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Parameters.Refresh and RETURN setof TEXT
Date: 2006-08-19 13:20:25
Message-ID: 44E71019.9080704@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message noreply 2006-08-20 06:05:21 [ psqlodbc-Bugs-1000708 ] SQLPrimaryKeys missing PK_NAME is NULL
Previous Message noreply 2006-08-19 08:30:48 [ psqlodbc-Bugs-1000710 ] CHAR field of resultset contains garbled data