Home » SQL & PL/SQL » SQL & PL/SQL » How to know which select statement is raising error (oracle 9i)
How to know which select statement is raising error [message #310132] Mon, 31 March 2008 06:39 Go to next message
krishna.apps
Messages: 3
Registered: March 2008
Location: Chennai
Junior Member
Hi

In my procedure I have three select statements.

In exception block I have one exception handler like No_data_found.
while I run my proceure. I am getting no_data_found. but I want to Know which select Statement is giving this error.

How..?

Pls help me
Re: How to know which select statement is raising error [message #310138 is a reply to message #310132] Mon, 31 March 2008 07:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As you are an expert, you don't need us to answer this question.

This is NOT an expert question. Why did you post this in expert forum and not in newbie one?

It is clearly stated in the forum description: "Newbies should not post to this forum!"
Expert notion is defined in the sticky: Not an EXPERT? Post in the NEWBIES forum, NOT here
Rules are described in: OraFAQ Forum Guide
Read them, follow them.


Regards
Michel
Re: How to know which select statement is raising error [message #310142 is a reply to message #310132] Mon, 31 March 2008 07:15 Go to previous messageGo to next message
sispk6
Messages: 164
Registered: November 2006
Location: pakistan
Senior Member
well add exception to each unit like
declare

b number ;
a number ;
error  varchar2(10) ;

begin

  begin
     select a into b from dual ;
  exception when no_data_found then
     error := 's1' ;
 end ; 
  begin
     select c into d from dual ;
   exception when no_data_found then
     error := 's2' ;
  end ; 
  
  message('error is in select statement no '||error);
  
exception when 
end ;



[Updated on: Mon, 31 March 2008 07:18]

Report message to a moderator

Re: How to know which select statement is raising error [message #310271 is a reply to message #310132] Mon, 31 March 2008 16:06 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
put some instrumentation in your code.

Kevin
Re: How to know which select statement is raising error [message #310272 is a reply to message #310132] Mon, 31 March 2008 16:12 Go to previous message
coleing
Messages: 213
Registered: February 2008
Senior Member
Also see what happens to your error message when:-

1. You dont have an exception section.

2. You use DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
Previous Topic: Executing procedure using procedure
Next Topic: mutating error problem
Goto Forum:
  


Current Time: Thu Dec 08 08:10:22 CST 2016

Total time taken to generate the page: 0.09468 seconds