Clarification regarding "Raise Application Error" and "seq_collision exception"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muzu1232004
    New Member
    • Aug 2007
    • 16

    Clarification regarding "Raise Application Error" and "seq_collision exception"

    What does the RAISE_APPLICATI ON_ERROR mean ? When this error is raised whether the database errors are occurred ? Please can any one explain clearly what this error means ?

    Also What does the seq_collision exception means and when it will be raised under what conditions ? What is the general correction to be done when this type of error occurs ?
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by muzu1232004
    What does the RAISE_APPLICATI ON_ERROR mean ? When this error is raised whether the database errors are occurred ? Please can any one explain clearly what this error means ?

    Also What does the seq_collision exception means and when it will be raised under what conditions ? What is the general correction to be done when this type of error occurs ?

    RAISE_APPLICATI ON_ERROR is used to create a user defined error messages.

    The user defined messages are associated with the user defined number (SQLCODE) using RAISE_APPLICATI ON_ERROR.

    Eg:
    DECLARE
    a NUMBER := 0;
    b NUMBER := 10;
    BEGIN
    IF(a = 0) THEN
    RAISE_APPLICATI ON_ERROR(-20000,' Cannot Divide by Zero');
    ELSE
    b: = b/a;
    END IF;
    END;

    The number passed in the RAISE_APPLICATI ON_ERROR should be negative and between -20000 and -20999

    Comment

    • AdusumalliGopikumar
      New Member
      • Aug 2007
      • 42

      #3
      Raise_applicati on_Error is used to defined a user defined exceptions to the stored sub programmes

      raise_applicati on_error(-20001,'user defined exception',TRUE/FLASE);

      if 3rd arg is TRUE it stores the user defined exceptions in Stack

      if it is FALSE then it will clear all from stack

      it's range starts from -20001 to -99999

      Comment

      Working...