12.2k views
1 vote
If the values in an SQL view are not changeable through the view itself, you may still be able to update the view by using unique application logic. In this case, the specific logic is placed in ________.

1) a BEFORE trigger
2) an INSTEAD OF trigger
3) an AFTER trigger
4) Depending on the specific logic, either A or B can be used.
5) Depending on the specific logic, any of A, B, or C can be used.

User Vicky S
by
8.0k points

1 Answer

1 vote

Final answer:

In SQL, when a view cannot be updated directly, you can use an INSTEAD OF trigger to apply specific logic to perform update operations, making it the correct choice for updating a non-updatable view.

Step-by-step explanation:

If the values in an SQL view are not changeable through the view itself, you may still be able to update the view using specific application logic. This logic is typically placed in an INSTEAD OF trigger. This type of trigger is designed to perform specific operations that occur instead of the triggering event, such as an update operation on a view that isn't directly updatable. Therefore, the correct answer is: 2) an INSTEAD OF trigger.

A BEFORE trigger is used to execute business rules or other actions before the triggering statement is executed, and an AFTER trigger is used to perform operations following the triggering event. However, these types of triggers cannot be used to make a non-updatable view updatable; this functionality is specific to INSTEAD OF triggers.

User Andrew Evt
by
9.0k points