ADO adCmdStoredProc PlPgSql-SP Parameters

From: Postgre(dot)News(dot)Firma(at)spamgourmet(dot)net
To: pgsql-general(at)postgresql(dot)org
Subject: ADO adCmdStoredProc PlPgSql-SP Parameters
Date: 2005-02-03 13:02:56
Message-ID: 000301c509f0$ae32c110$ca64a8c0@muenchen.oneXtwo.ag
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

How do I call a StoredProcdure, written in PlPqSql
which returns a set of records (or tableWhatever)
and wants parameters,
from ADO while using "adCmdStoredProc" ?

ERROR: set-valued function called in context that cannot accept a set

---------------------- VERY LONG VERSION OF THIS QUESTION
-------------------------

When I use Microsoft SQL-Server I make a SP like

CREATE PROCEDURE _test AS
select * from evt_event
return 42
GO

I call it just via name.

When I use PostgreSql I make a SQL-SP like

CREATE OR REPLACE FUNCTION "public"."_test" () RETURNS SETOF "public"."t1"
AS
$body$
select * from t1;
$body$
LANGUAGE 'sql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

I call it just via name too.

When I use PostgreSql I make a PLPG-SQL-SP like
CREATE OR REPLACE FUNCTION "public"."_test" () RETURNS SETOF "public"."t1"
AS
$body$
declare
rs record;
begin
for rs in select * from t1 loop
return next rs;
end loop;
RAISE NOTICE '42';
return;
end;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

How do I call this one ? (using adCmdStoredProc)

In the SQL-Editor I may call both pg-SPs via "select * from _test()"

EMS PostgreSql Manager SQL-Editor:
VariantePG1: select * from _test() : ok
VariantePG2: select * from _test() : ok

Ado:
RECORDSET rs = adoRecordSet.open <command>,...., adCmdStoredProc

VarianteMS : ok
VariantePG1: ok
VariantePG2: ERROR: set-valued function called in context that cannot
accept a set

Help,
Andreas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pam Eggler 2005-02-03 16:03:34 vacuum ran out of space and now i cant get back into db
Previous Message Roman Neuhauser 2005-02-03 12:37:54 Re: SQL query question