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!
http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://imagine-msn.com/themes/vibe/default.aspx?locale=en-us&source=hmtagline