Re: [HELP]: PL/SQL Exceptions to Forms4.

From: Lee levy <levy.lee.ls_at_bhp.com.au>
Date: 1995/11/27
Message-ID: <49db86$73p_at_merlin.resmel.bhp.com.au>#1/1


You dont have an exception handler, so you arent telling it what to do. Try:
CREATE TRIGGER AFFILIATION_TRIGGER
  BEFORE INSERT OR UPDATE OF Start_Date, End_Date ON Affiliation   FOR EACH ROW
  DECLARE
    My_Exception EXCEPTION;
  BEGIN
    IF :New.Start_Date > :New.End_Date THEN       RAISE My_Exception;
    END IF;
  EXCEPTION
    WHEN My_Exception THEN

  • whatever you want done END;
HIH
Lee
      /\/\      :  Lee Levy, ISSD Systems Development
     / / /\     :  BHP Information Technology (WOLLONGONG REGION)
    / / /  \    :  PO Box 261, Warrawong, NSW 2502, Australia
   / / / /\ \   :  ACN 006 476 213
   \ \/ / / /   :  Telephone:  +61 42 75-5485  (tie-line 8855-)
    \  / / /    :  Facsimile:  +61 42 75-5500
     \/\/\/     :  Internet :  levy.lee.ls_at_bhp.com.au

====================================================================
Opinions expressed are my own and not necessarily those of either my employer or their clients

In article <Pine.A32.3.91.951127155717.28046A-100000_at_pilot.stu.cowan.edu.au>, Christopher Muir <st952943_at_pilot.stu.cowan.edu.au> says:

>
>Howdy.
>
>Hope you can help me.
>
>Have implemented the following trigger in SQL*+ PL/SQL:
>
>CREATE TRIGGER AFFILIATION_TRIGGER
>  BEFORE INSERT OR UPDATE OF Start_Date, End_Date ON Affiliation
>  FOR EACH ROW
>  DECLARE
>    My_Exception EXCEPTION;
>  BEGIN
>    IF :New.Start_Date > :New.End_Date THEN
>      RAISE My_Exception;
>    END IF;
>  END;
>/
>
>What the trigger is simply meant to do is ensure that start_date is less than
>or equal to end_date.  If not it should call the exception My_Exception.
>
>Now when I goto Forms4 and create a form on table affiliation, I do get a 
>raised error if the condition is true (ie start_date > end_date).  
>However Oracle comes up with its standard FRM-40508: ORACLE err - unable 
>to INSERT record.  I don't want this.  I want to capture this error and 
>display a user friendly error to the message.
>
>How do I capture the exception?
>
>Note that I have not declared the exception in the PL/SQL or the Forms4.  
>It is as is above.
>
>
>Hope you can help, and thanks in advance :>
>
>Please send any reply to email address below.
>
>Chris.
>
>*CHRIS MUIR********************************************************************
>* "Destiny is not a matter of chance, it is a matter of choice; it is not a   *
>*  thing to be waited for: it is a thing to be achieved."                     *
>*st952943_at_Pilot.Stu.Cowan.Edu.Au***EDITH COWAN UNIVERSITY OF WESTERN AUSTRALIA*
>
Received on Mon Nov 27 1995 - 00:00:00 CET

Original text of this message