Connecting Tech Pros Worldwide Help | Site Map

Exception In Ref Cursor

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 12th, 2007, 09:30 PM
Newbie
 
Join Date: Jul 2007
Posts: 15
Default Exception In Ref Cursor

Hi all,
How can i raise an exception in ref cursor.

CREATE OR REPLACE PACKAGE demo
is
TYPE empcurtyp IS REF CURSOR;
PROCEDURE getempdetails(job_title in varchar2, emp_refcur out empcurtyp);
END demo;


CREATE OR REPLACE PACKAGE BODY demo
IS
PROCEDURE getempdetails(job_title in varchar2,emp_refcur out empcurtyp)
IS
BEGIN
OPEN emp_refcur
FOR
SELECT *
FROM emp
WHERE job = job_title;
EXCEPTION
WHEN no_data_found
THEN
dbms_output.put_line('No Data for '|| job_title);
end getempdetails;
end;

Var a refcursor
exec demo.getempdetails('President',:a)

If there is no job_title as 'President',i need to display these message
dbms_output.put_line('No Data for '|| job_title);

Thanks
Raghu
Reply
  #2  
Old July 13th, 2007, 05:15 AM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,313
Default

You can't use dbms_output.put_line to print a ref cursor.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.