Getting Result set from Oracle Stored procedure
We're in the process of running a "proof-of-concept" porting a subset of one
of out applications from Sybase 11.x to Oracle 8.x.
One of the features we've relied heavily on in Sybase is the ability to
return a result set from within a stored procedure as if it where a normal
select. So in a TQuery component the procedure is run by submitting an "EXEC
Proc @Foo = 1" SQL string, and retrieving the results in the "normal" way
from the TQuery, as if a select had been executed.
However in Oracle this doesn't seem to be the case. The consulting company
that did the port of the TSQL to PL/SQL substituted cursor variables in the
parameter list of the procs to emulate this, but I can find no way of
getting this to work within Delphi.
Simple Oracle Proc -
CREATE OR REPLACE PROCEDURE Pr_GetPortfolios
(p_PortfCV IN OUT CursorVarDef.PortfCursorType) IS
BEGIN
--
OPEN p_PortfCV FOR
SELECT PfCode, PfDesc
FROM Portfolios;
--
END Pr_GetPortfolios;
Supposedly equivilant to Sybase -
create procedure Pr_GetPortfolios
begin
select PfCode, PfDesc
from Portfolios
end
Is it possible to use the TQuery for these or is does TStoredProc support
this sort of thing? And how do you drive it anyway?
Any pointers gratefully appreciated.
Andrew Mannering
Sybase DBA