Re: newbie question on triggers
Date: 1995/10/11
Message-ID: <45hgsp$pe4_at_qualcomm.com>#1/1
In article <1995Oct11.165501_at_seuss.cc.utexas.edu>, godzilla_at_seuss.cc.utexas.edu (Jim Lyons) says:
>
>1) I have a table in which some columns have the "not null" clause.
>
>2) I have written an insert trigger which is to be fired -before- insertion.
>
>3) I have code in my trigger to test the not-null columns and, if the user
>has not provided data, write a message saying specifically which required
>field was omitted (or, at least, the first detected).
>
>4) Yet, when I insert data into that table, with null values in the required
>field, I get the Oracle error message and my trigger is not fired at all.
>
>I want to keep the field defined as "not null" for documentation reasons and
>to make -real- sure data integrity is observed (just in case someone with
>the necessary authority but not the necessary knowledge drops the trigger).
>I want the trigger to work for reason 3 above.
>
>Is there any way I can do this?
>
>--
When the data is inserted first it validates with the data dictionary of the table (like not null,field type etc.,) and when it is successfull then only triggers (if any) are fired. In your case the same thing is happening. As no data is entered and where as the column is not null it will not go ahead. Even though your purpose is meaningful but still there is no way. If you want trap the trigger message then you have remove 'not null'. Let us see any one else has other ideas.... Received on Wed Oct 11 1995 - 00:00:00 CET