Re: DBA Prep -- Sample question

From: Paul Berger <pberger_at_nic.wat.hookup.net>
Date: 1996/03/08
Message-ID: <4hpue8$lo6_at_nic.wat.hookup.net>#1/1


Is this kind of question really important if one is charged with keeping a complex Oracle database tuned & running...as is required of most DBA's? PB

In article <4hnb4f$18v2_at_watnews1.watson.ibm.com>, <mlanda_at_vnet.ibm.com> wrote:
>In <4hi6p0$oed_at_news.Belgium.EU.net>, ghp_at_infosoft.be (Gerard H. Pille) writes:
>>In article <Pine.SUN.3.91.960304131005.1188A-100000_at_seatimes>,
>>sbut-is_at_seatimes.com says...
>>!>
>>!>In a previous thread we proposed posting some of the DBA Prep questions
>>!>that seemed to have incorrect answers. In order to generate discussion
>>!>I'll not reveal the perported "correct" answers until folks have had a
>>!>chance to form an opinion.
>>!>
>>!>QUESTION:
>>!>A BEFORE INSERT trigger is created to do validation on a column created
>>!>as not NULL. The purpose of the trigger is to check the contains (sic)
>>!of
>>!>the column and display a message "Column cannot be NULL" if the column
>>!is
>>!>NULL. What will happen? (May have multiple answers)
>>!>
>>!>A. The trigger will be fired and it will check value of the colmn and
>>!> return a message when the column is NULL.
>>!>B. The trigger will never be fired even when the column is NULL.
>>!>C. The message "Column cannot be NULL" will never be displayed.
>>!>D. The trigger is always fired whenever data is inserted into thie
>>!table.
>>!>
>>!>You choice(s):
>>!>
>>!>--Steve
>>!>
>>I don't know how a trigger would 'return' or 'display' a message, so I'd
>>bet on C & D.
>
>
>This question is not as straight forward as it seems. Answer C is correct
>not because you cannot display a error message (because you can display
>an error message using raise_application_error), but because the not null
>column constraint appears to have precendence over the trigger. So if
>I try to insert a null value into a column with a not null constraint, I
>will get an ORA-01400 system error. No error message from the trigger. Answer
>D and A would be correct (and C incorrect) if it were not for the not null
>constraint. But as it stands, because of this constraint, any attempt
>to insert a null value will result in a system error (ORA-01400), not a
>trigger error; the trigger never fires in this case.
>
>
>
>
>
>M.Landa
>
Received on Fri Mar 08 1996 - 00:00:00 CET

Original text of this message