Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL access from c++ like accessing a table
On Fri, 18 Jun 2004 14:21:11 +0200, "Moritz Klein"
<mklein_at_students.uni-mainz.de> wrote:
>My questions are:
>Is it possible to to something like "select * from procedure_x(var1,var2)"
>and get a result-set similar to doing "select * from table_x"?
>If it is possible, do you have any hints, documentation you can give me as
>an advice?
it is not possible to do it in this fashion as a procedure doesn't
return anything. You are mistaking a procedure for a function.
However the customary solution is to write a procedure
with a REF CURSOR as OUT parameter.
This type of procedure can be called from most front-end tools and
report writers.
In sql*plus you can do the following
variable x refcursor;
begin
<your procedure>(:x, <your parameters>;
end;
print x
REF CURSOR is definitely documented in Feuerstein's books and Oracle's PL/SQL documentation.
-- Sybrand Bakker, Senior Oracle DBAReceived on Fri Jun 18 2004 - 15:51:00 CDT
![]() |
![]() |