nerdexam
Oracle

1Z0-151 · Question #63

The Orders form, whose properties have not been changed from the default, has two non-base table text items to display the sales representative's first and last names. You want to ensure that…

The correct answer is B. Raise the FORM_TRIGGER_FAILURE exception. C. Add code to handle the TOO_MANY_ROWS exception. See the full explanation below for the reasoning.

Question

The Orders form, whose properties have not been changed from the default, has two non-base table text items to display the sales representative's first and last names. You want to ensure that entries made in these Items correspond to an existing employee, so you write a When-Validate-Item trigger for the Sales_Rep_First_Name text item:

SELECT LAST_NAME Into :last_name FROM employees WHERE first_name = :first_name; EXCEPTION WHEN NO_DATA_FOUND THEN MESSAGE ('There is no sales rep by this name'); When you test the form and enter a first name that does not exist in the database, the message that you specified appears, but the cursor goes to the Sales_Rep_Last_Name item. You want the cursor to remain in the Sales_Rep__First Name item until a correct first name is entered. Also, as you continue to test the form, at times, the cursor does not leave the Sales_Rep_First_Name item after you enter a name, but no error message appears. Which two things can you do to correct these problems?

Options

  • AAdd the code to handle the FORM_TRIGGER_FAILURE exception.
  • BRaise the FORM_TRIGGER_FAILURE exception.
  • CAdd code to handle the TOO_MANY_ROWS exception.
  • DRaise the TOO_MANY_ROWS exception.
  • ECode an On-Error trigger.
  • FCode an On-Message trigger.
  • GWrite a When-Validate-Item trigger for the Sales_Rep_Last_Name item.
  • HMove the code to a form-level When-Validate-Item trigger.

How the community answered

(34 responses)
  • B
    74% (25)
  • D
    3% (1)
  • E
    6% (2)
  • F
    15% (5)
  • G
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-151 Practice