Home » SQL & PL/SQL » SQL & PL/SQL » NO DATA FOUND exception
NO DATA FOUND exception [message #305279] Mon, 10 March 2008 05:28 Go to next message
hedonist123
Messages: 119
Registered: August 2007
Senior Member
Hi,

I am using a procedure to return several values from different tables into certain OUT parameters that I have declared.

Now, as there is no data in the tables from which I am accessing the data, it is returning no data found exception.

select
 x,
 y,
 z
into
 px,
 py,
 pz
from 
 abc
where
abc.id = pid


pid is what I pass as an input parameter to the procedure.

Could you please tell me how to overcome this error?

I want the SP to retrurn nulls if there is no data instead of erroring out.

Thanks,

Sharath
Re: NO DATA FOUND exception [message #305282 is a reply to message #305279] Mon, 10 March 2008 05:33 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
so handle the exception accordingly.

 When No_data_found then
<handle_your_exception>


regards,
Re: NO DATA FOUND exception [message #305296 is a reply to message #305279] Mon, 10 March 2008 05:58 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
PL/SQL User's Guide and Reference
Chapter 10 Handling PL/SQL Errors

Regards
Michel
Previous Topic: Difference between where and having clause
Next Topic: SQL query for update
Goto Forum:
  


Current Time: Sun Dec 04 18:32:39 CST 2016

Total time taken to generate the page: 0.10231 seconds