-
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 .
Eat , Drink & Enjoy life -
pravin_kini@hotmail.com
-
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..?
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
-
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;
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
-
You can trap the sql error code / msg and act accordingly...again possible through exceptions.
Vinit
-
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
anandkl
-
-
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)..
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|