473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Jul 12 '07 #1
1 1945
debasisdas
8,127 Expert 4TB
You can't use dbms_output.put_line to print a ref cursor.
Jul 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Scott J. Chlebove | last post by:
I am running a PL/SQL module in which I do the following.... BEGIN DBMS_OUTPUT.enable(1000000); -- Open file for writing. OutfileHandler1 := UTL_FILE.FOPEN(wc_file_path, wc_output_file1,...
1
by: Pondy | last post by:
Hi I have a strange problem with my SQL server 2k instllation - every 10 mintutes when I have the Profiler trace with the entire "Errors" Event category selected, the following 5 exceptions show...
1
by: Tor Erik Soenvisen | last post by:
try: self.cursor.execute(sql) except AttributeError, e: if e.message == "oracleDB instance has no attribute 'cursor'": e.message = 'oracleDB.open() must be called before' + \ ' oracleDB.query()'...
1
by: Lee | last post by:
Hi all, been playing with some code overriding WndProc to get information about mouse events. So far I've tried to capture when the left mouse button is pressed using the code below. Sometimes...
5
by: johnny | last post by:
I want to print individual exception for database connection, sql execution, database closing, closing the cursor. Can I do it with one try..catch or I need a nested try...catch? conn =...
9
by: Frawls | last post by:
Hi I Am am having problems with a stored Procedure that i wrote. Basically whats happening is that the Stored procedure Runs fine when i EXECUTE it in SQL Query analyzer. But when i debug...
4
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ...
5
lotus18
by: lotus18 | last post by:
WaAh! My form was working fine earlier but later it displays Invalid Operation Exception was unhandled. I don't know what's wrong with my form every time I load it.I checked its codes but I find...
1
by: morrisqueto | last post by:
Hello, One of my websites just started sending a new rare error. The site has been working for almost 2 years without trouble, but today morning started giving away this error in all my views. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.