Which two things can you do to correct these problems?

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?

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?

A.
Add the code to handle the FORM_TRIGGER_FAILURE exception.

B.
Raise the FORM_TRIGGER_FAILURE exception.

C.
Add code to handle the TOO_MANY_ROWS exception.

D.
Raise the TOO_MANY_ROWS exception.

E.
Code an On-Error trigger.

F.
Code an On-Message trigger.

G.
Write a When-Validate-Item trigger for the Sales_Rep_Last_Name item.

H.
Move the code to a form-level When-Validate-Item trigger.

I.
Change the form’s validation Unit property to Record.

Explanation:
A: FORM_TRIGGER_FAILURE Exception
Triggers fail only when one of the following occurs:
*An unhandled exception
*When you request the trigger to fail by raising the built-in exception
FORM_TRIGGER_FAILURE
This exception is defined and handled by Forms Builder, beyond the visible trigger text that
youwrite. You can raise this exception:
* In the executable part of a trigger, to skip remaining actions and fail the trigger
*In an exception handler, to fail the trigger after your own exception-handling actions havebeen
obeyedIn either case, Forms Builder has its own exception handler for
FORM_TRIGGER_FAILURE , which fails the trigger but does not
cause an unhandled exception. This means that you can fail the trigger in a controlled manner.
C: When you use SELECT in a PL/SQL block, it’s important to make sure that exactly one row will
always be returned by your query. If more than one row is returned, the TOO_MANY_ROWS
exception occurs.
Note 1_When-Validate-Item fires when Forms validates an item.
Note2:The scope of a trigger is determined by its position in the formobject hierarchy—that is,
thetype of object under which you create the trigger. There are three possible levels that answer
the“What Level?”question in the slide graphic:•
Form level:
The trigger belongs to the form and can fire due to events across the entireform.•
Block level:
The trigger belongs to a block and can fire only when this block is the currentblock.•
Item level:
The trigger belongs to an individual item and can fire only when this item isthe current item



Leave a Reply 4

Your email address will not be published. Required fields are marked *


fatima

fatima

B is correct but whats the 2nd answer? is it C or E

ngayathri81

ngayathri81

Answer- B, C