Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL access from c++ like accessing a table

Re: PL/SQL access from c++ like accessing a table

From: Sybrand Bakker <gooiditweg_at_sybrandb.verwijderdit.demon.nl>
Date: Fri, 18 Jun 2004 22:51:00 +0200
Message-ID: <97l6d0l4abt11fnvap87n6dv287aakgbu7@4ax.com>


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 DBA
Received on Fri Jun 18 2004 - 15:51:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US