1Z0-141 · Question #41
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…
The correct answer is A. Change all occurrences of message_code, message_type, and message_text to error_code. See the full explanation below for the reasoning.
Question
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 corrections can you make so that the code functions properly?
Options
- AChange all occurrences of message_code, message_type, and message_text to error_code,
- BEliminate the to_char function because message_code is a varchar2 value.
- CTo keep the remaining code from executing, add after the second line:
- DChange all occurrences of message_code, message_type, and message_text to
How the community answered
(57 responses)- A79% (45)
- B14% (8)
- C5% (3)
- D2% (1)
Community Discussion
No community discussion yet for this question.