Home Interview Questions and Answers PL/SQL Interview Questions and Answers For Graduates Part-4

PL-SQl31.Say True or False. If False, explain why.
A trigger can execute the COMMIT, ROLLBACK, or SAVEPOINT commands.

A trigger cannot execute the COMMIT, ROLLBACK, or SAVEPOINT commands.

32.What is the use of a WHEN clause in a trigger?
A WHEN clause specifies the condition that must be true for the trigger to be triggered.

33.Say True or False. If False, explain why.
Statement level triggers are triggered only once.

True.

34.What is the purpose of the optional argument [OR REPLACE] in a CREATE TRIGGER command?
The optional argument [OR REPLACE] in a CREATE TRIGGER command re-creates an existing trigger. Using this option allows changing the definition of an existing trigger without having to delete it first.

35.Say True or False. If False, explain why.
INSTEAD OF is a valid option only for triggers in a table.

False. INSTEAD OF is a valid option only for views. INSTEAD OF trigger cannot be specified in a table.

36.Write a statement to disable a trigger named update_marks.
ALTER TRIGGER update_marks DISABLE;

37.Which command is used to delete a trigger?
DROP TRIGGER command.

38.Which command is used to delete a procedure?
DROP PROCEDURE command.

39.What is the difference between a function and a stored procedure?
A function returns a value and a stored procedure doesn’t return a value.

40.How do you declare a user-defined exception?
User defined exceptions are declared under the DECLARE section, with the keyword EXCEPTION. Syntax −

<exception_name> EXCEPTION;

You may also like

Leave a Comment