Home » SQL & PL/SQL » SQL & PL/SQL » Returning morethan one value from Procedure (Oracle 9i)
Returning morethan one value from Procedure [message #379047] Sun, 04 January 2009 03:46 Go to next message
ramesh55.sse
Messages: 262
Registered: December 2008
Location: Hyderabad
Senior Member
create or replace procedure p1
is
cursor c is
select * from emp;
begin
for i in c
loop
dbms_output.put_line(i.empno||i.ensme);
end loop;
end;
/
By using this code we can retrieve morethan one value from procedure.But why we go for Ref cursor?
Re: Returning morethan one value from Procedure [message #379053 is a reply to message #379047] Sun, 04 January 2009 04:31 Go to previous messageGo to next message
rajput.anshu
Messages: 45
Registered: October 2008
Location: Bangalore
Member
This is not a Ref cursor......It is simple cursor.......Ref cursor syntax is----Type <type_name> is ref cursor [return <return type>]

Eg. Type A is ref cursor return emp%rowtype or
Type A is ref cursor return select * From emp;
Re: Returning morethan one value from Procedure [message #379058 is a reply to message #379047] Sun, 04 January 2009 04:52 Go to previous message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
First search in documentation:
PL/SQL User's Guide and Reference
Application Developer's Guide - Fundamentals

And also read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags.
Use the "Preview Message" button to verify.

Regards
Michel
Previous Topic: pl/sql Table
Next Topic: Procedures and Functions (merged 6 BB and MC)
Goto Forum:
  


Current Time: Wed Dec 07 09:04:15 CST 2016

Total time taken to generate the page: 0.15448 seconds