-
SQL query how to find !!
Thanks in advance
I am running a batch of 5000 inserts & update sql for a particular user. Out of 5000 sql some are getting executed and some are
failing
I want to know how to find those failed ones.
apart from spool option any other solution is there. let me know .
-
take copy of the table before update.
take copy of the table after update.
now you compare these two.
difference in count is the successful inserts.
difference in values is the successful updates.
-Raja
-
thas painful...
why not handle in Exceptions..?
-
abhaysk,
how can we handle this in exceptions?
some more clues.....
thank you!
Raja
-
Code:
Begin
SQL_STATEMENT;
Exception
When Others Then
{Do What Ever U Want};
End;
-
You can trap the sql error code / msg and act accordingly...again possible through exceptions.
-
U can put the SQL in a script and send the output to log file, from the log file u can know which all updates failed, correct them and reexcute.
regards
anandk
-
-
If i have 100 inserts to be done, and there is a error at 50 th record, then the control jumps to Exception. Right ????
Is there any way that i just skip this bad record and continue with the rest 50 records ????
-
For every statement have a Begin .. Exception !!
(am not sure how u can pass the control back to next statement after error with having only an exception)..