The following On-Error trigger was written to give users a more meaningful message when they press the Up key when the cursor is in the first record (the FRM-40100 error) and to display default messages for all other errors:
IF message_code = 40100 THEN
MESSAGE(‘You are already at the first record’);
ELSE
MESSAGE(message_type || ‘-‘ ||
to_char(message_code) | ‘-‘ || message_text);
END IF;
When you test the form, you still get the FRM-40100 message when you press the Up key while the cursor is in the first record. Your custom message does not appear.
What correction can you make so that the code functions properly?
A.
Change all occurrences of message_code, message_type, and message_text to error_code, error_type, and error_text.
B.
Eliminate the to_char function because message_code is a varchar2 value.
C.
To keep the remaining code from executing, add after the second line:
RAISE FORM_TRIGGER_FAILURE;
D.
Change all occurrences of message_code, message_type, and message_text to DBMS_error_code, DBMS_error_type, and DBMS_error_text.