Returning stored procedure results to query tool
Date: Wed, 11 May 1994 18:31:15 GMT
Message-ID: <s68.80.2DD12473_at_ornl.gov>
I'm using several end-user query tools such as Q+E 5.0 and Microsoft Query (with Excel 5.0) to access data on our Oracle 7 database. We previously used Sybase and created a bunch of stored procedures in the database and then executed them from our end-user tools. We could even pass parameters. For example, if I wanted a list of all the people in a certain department, I could send the SQL command "empdept '6169'" where empdept was the procedure name and '6169' was the department. The procedure was simply a select * from dept where deptno='parameter passed'. This returned the results to my query tool in the form of a table.
create or replace procedure test_proc
is
a varchar2(6); b varchar2(2); cursor c1 is select * from test_table; begin open c1; loop fetch c1 into a,b; -- could also be a 'table' or 'record' exit when c1%notfound; dbms_output.put_line(a); -- these 2 lines just display the dbms_output.put_line(b); -- data retrieved end loop;
end;
I can execute the above procedure from my end-user query tool but I don't know
were the results go to. I just get a message about the procedure executed
successfully.
What I'd really like to do is get Oracle to return results of a stored
procedure like Sybase does. Does anyone have any tricks or suggestions.
Thanks,
/ Steve Stansfield ___/ | Martin Marietta Energy Systems __/ / Oak Ridge, TN __/ / s68_at_ornl.gov (615)241-3693 _/ |______________________________________/Received on Wed May 11 1994 - 20:31:15 CEST