Multiple choice technology databases

Examine this database trigger CREATE OR REPLACE TRIGGER prevent_gross_modification {additional trigger information} BEGIN IF TO_CHAR(sysdate, DY) = MON THEN RAISE_APPLICATION_ERROR(-19999,'user Defined error'); END IF; END; This trigger will error out

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The trigger code has a syntax error: TO_CHAR(sysdate, DY) should be TO_CHAR(sysdate, 'DY') with quotes around the format mask. Additionally, the comparison should be TO_CHAR(sysdate, 'DY') = 'MON' with quotes around the day value. As written, this will cause a compilation error, so the statement that it 'will error out' is correct.