| vidhu |
Posted: May 07, 2008 03:08:34 AM |
Total Post: 7
Joined: Apr, 2008
|
| Suppose my procedure is having 100 select statements and among them one select statement is creating error how to get which line of select statement is having error.with out using dbms_output.put_line. |
|
|
Mohammed Taj |
| Posted: May 07, 2008 03:21:29 AM | |
|
Total Post: 634
Joined: Jul, 2007
|
When you compile that procedure that time error message with line display.
|
|
|
|
|
vidhu |
| Posted: May 07, 2008 03:42:10 AM | |
|
Total Post: 7
Joined: Apr, 2008
|
Thank U Taj for ur instant reply.
But my problem is not while compileing the proc.This proc compiled without any error but at runtime due to some data problem a particular select statement is failed how to track which one is failed.
|
|
|
|
|
http://sharear.blogspot.com |
| Posted: May 07, 2008 05:29:51 AM | |
|
Total Post: 48
Joined: Apr, 2008
|
please attach the full error message.
|
|
|
|
|
Murtuja |
| Posted: May 07, 2008 07:32:57 AM | |
|
Total Post: 588
Joined: Jan, 2006
|
You are facing logical error in your procedure so you need to put lot of dbms_output staments in your procedure and start debugging.
|
|
|
|
|
Murtuja |
| Posted: May 08, 2008 02:47:26 AM | |
|
Total Post: 588
Joined: Jan, 2006
|
Hi,
Do you have any updates regarding this issue ?
|
|
|
|
|
vidhu |
| Posted: May 08, 2008 05:25:09 AM | |
|
Total Post: 7
Joined: Apr, 2008
|
Hi Murtuja,
Actually this question is an interview question.
Even i said the same answer i will be putting Dbms_output.Put_line and track the error but the interviewer said,that proc will be having 100 select statements its not best way to use dbms_output on each line he needs a much better and easy way of identifying the statement.
Thanks for ur interest.
|
|
|
|
|
Murtuja |
| Posted: May 08, 2008 05:59:31 AM | |
|
Total Post: 588
Joined: Jan, 2006
|
Hi,
When select statement failed to fetch any records then "when_no_data_found" exception is raised and you can catch it.
Just a thought.
|
|
|
|
|
vidhu |
| Posted: May 08, 2008 06:19:55 AM | |
|
Total Post: 7
Joined: Apr, 2008
|
Ya i agree but even that also will not give from which select statement control moves to the exception.
Even i said this....
I said all the possibilities which i know even after that also that interviewer was not satisfied.
Thats why i am asking any possibilities are there to arrive this.
Thanks
|
|
|
|
|
Murtuja |
| Posted: May 08, 2008 06:31:49 AM | |
|
Total Post: 588
Joined: Jan, 2006
|
It's a really difficult question !!!
Suppose we use exit statement randomly and find out where is the problem
First Put exit statement in the middle of procedure and execute it...If no error then we are confirm that there is no error in the first part of procedure
Then put exit somewhere in the second part..that's how we can come to nearby problematic select statement.
|
|
|
|
|
vidhu |
| Posted: May 08, 2008 06:34:35 AM | |
|
Total Post: 7
Joined: Apr, 2008
|
May be the way how u said....
Anyhow thanks for ur interest in answering.
If u find any best way for this just give an update...
|
|
|
|
|
Murtuja |
| Posted: May 08, 2008 07:17:49 AM | |
|
Total Post: 588
Joined: Jan, 2006
|
Hi,
Exceptions Handling only can be answer to this question.It's good practise to put lot of EXCEPTION section in a code.
Read this link
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/errors.htm#i7014
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |