DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Longmont, Colorado

    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 johns@myco.com... 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

    That's understandable...

    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??

  2. #2
    Join Date
    Aug 2002
    Colorado Springs
    You'd need to handle that exception with an EXCEPTION clause ... http://download-west.oracle.com/docs...s.htm#LNPLS007
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Jun 2002
    Longmont, Colorado
    READ THE DOCUMENTATION!!! (I know, I know...)
    Thanks slimdave.

    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...)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.