ADO, set returning functions, ms acccess - Mailing list pgsql-odbc

From brian stapel
Subject ADO, set returning functions, ms acccess
Date
Msg-id BAY107-W981B1A98A797D6C2F4B0CA11F0@phx.gbl
Whole thread Raw
Responses Re: ADO, set returning functions, ms acccess
List pgsql-odbc
Thanks for your time...
 
I've written a plpgsql function that produces a recordset (i think):
 
CREATE OR REPLACE FUNCTION "public"."function_name" (int integer) RETURNS SETOF "public"."tbl_nm" AS
$body$
/* New function body */
DECLARE
       rec public.tbl_nm;
    BEGIN
        FOR rec IN
              select * from tbl_nm where id <> int
        LOOP
            RETURN NEXT rec;
        END LOOP;
    END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
 
When I execute the function from the sql editor, it produces the desired results. select * from function_name(1);
 
When I try to incorporate this function into my ado application, it doesn't seem to return a recordset. 
 
    Dim objCnn As ADODB.Connection
    Dim cmd As ADODB.Command
    Dim rs As ADODB.Recordset
   
        Set objCnn = data_layer.Open_ConnectPostGRESql(objCnn)
        Set cmd = New ADODB.Command
       
        cmd.ActiveConnection = objCnn
       
        cmd.CommandText = "Select  * from function_name(1);"
       
        Set rs = cmd.Execute
 
rs record count is -1.
 
Can you help?
 


Express yourself - download free Windows Live Messenger themes! Get it now!

pgsql-odbc by date:

Previous
From: "Andrus"
Date:
Subject: Re: New release of psqODBC?
Next
From: Andreas
Date:
Subject: Re: ADO, set returning functions, ms acccess