Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2013
    Posts
    21

    Unanswered: Error handling in oracle.

    i have the following sql server stored procedure error block. in oracle do i have to include an error block or not cuz i think oracle follows all or nothing.
    any suggestions i wud appreciate ..


    if @@error <> 0 GOTO ABORT

    COMMIT TRAN
    set @sql_status = @@error
    RETURN @sql_status

    ABORT:
    PRINT 'Unexpected error occurred!'
    set @sql_status = -1
    ROLLBACK TRAN
    RETURN @sql_status

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    I agree with you.
    do NOT include any EXCEPTION handler code
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2013
    Posts
    21
    Quote Originally Posted by anacedent View Post
    I agree with you.
    do NOT include any EXCEPTION handler code
    Thanks for your instant response. I'm not including any expection block..

  4. #4
    Join Date
    Oct 2002
    Location
    Cape Town, South Africa
    Posts
    253
    My 2 cents:
    This is another spot where Oracle is better than SQL Server (in my opinion). Oracle treats errors as proper exceptions that are raised and caught unlike TSql that requires error code checks. At least TSql finally has a try block, but still has a lame reliance on severity code.

Posting Permissions

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