How to get procedure to continue....
My procedure loops through (each user in the database) and does a simple task of notifying users via email using UTL_SMTP.
The problem I have come across is this:
When the user is no longer with the company, then the email address that UTL_SMTP tries to send to is invalid and the procedure exits with this error:
ERROR at line 1:
ORA-29279: SMTP permanent error: 550 5.1.1 firstname.lastname@example.org... User unknown
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 98
ORA-06512: at "SYS.UTL_SMTP", line 240
ORA-06512: at "my.procedure", line 96
ORA-06512: at line 1
My question is: How do I make my procedure "ignore" this kind of error and have it continue through the loop and finish the procedures??
You'd need to handle that exception with an EXCEPTION clause ... http://download-west.oracle.com/docs...s.htm#LNPLS007
READ THE DOCUMENTATION!!! (I know, I know...)
I know how to handle it with an exception, the problem I still have is I want it to continue with the block if this particular exception occurs.
But after reading the documentation, I learned something new... Using sub-blocks! Sub-blocks can have it's own "local" exception handlers, which would exit the sub-block, but continue the main block!
Thanks again! (I've bookmarked that link...)
Click Here to Expand Forum to Full Width