Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 12th, 2007, 10: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, 06:15 AM
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 6,870
Default

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

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles