X-Original-To: pgsql-odbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id BCE469FB288 for ; Sat, 19 Aug 2006 10:20:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 12142-02 for ; Sat, 19 Aug 2006 13:20:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sd.tpf.co.jp (ftp.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 2CB389FB24A for ; Sat, 19 Aug 2006 10:20:30 -0300 (ADT) Received: (qmail 7850 invoked from network); 19 Aug 2006 22:20:27 +0900 X-Authentication: inoue was authenticated by dns.tpf.co.jp at 19 Aug 2006 22:20:27 +0900 Received: from unknown (HELO ?192.168.11.3?) (219.61.40.10) by dns.tpf.co.jp with SMTP; 19 Aug 2006 22:20:27 +0900 Message-ID: <44E71019.9080704@tpf.co.jp> Date: Sat, 19 Aug 2006 22:20:25 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: rodney@careerjunction.co.za CC: pgsql-odbc@postgresql.org Subject: Re: Parameters.Refresh and RETURN setof TEXT References: <005001c6c2f3$3e9ff670$332c13ac@careerjunction.local> In-Reply-To: <005001c6c2f3$3e9ff670$332c13ac@careerjunction.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/69 X-Sequence-Number: 8033 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