What is stored Procedure?

A stored procedure is a sequence of statement or a named PL/SQL block which performs one or more specific functions. It is similar to a procedure in other programming languages. It is stored in the database and can be repeatedly executed. It is stored as schema object. It can be nested, invoked and parameterized. A … Read more

What are the two virtual tables available at the time of database trigger execution?

Table columns are referred as THEN.column_name and NOW.column_name. For INSERT related triggers, NOW.column_name values are available only. For DELETE related triggers, THEN.column_name values are available only. For UPDATE related triggers, both Table columns are available. In PL/SQL, when a database trigger is executed, two special virtual tables are available: OLD and NEW. These tables are … Read more

Which command is used to delete a trigger?

DROP TRIGGER command. In PL/SQL, there is no specific command exclusively designed to delete a trigger. Instead, you use the DROP TRIGGER statement to remove a trigger from the database. Here’s the basic syntax: DROP TRIGGER [schema.]trigger_name; Replace [schema.]trigger_name with the appropriate schema and trigger name you want to delete. For example: DROP TRIGGER my_schema.my_trigger; … Read more

How to disable a trigger name update_salary?

ALTER TRIGGER update_salary DISABLE; In PL/SQL, you can disable a trigger using the following SQL command: ALTER TRIGGER trigger_name DISABLE; So, to disable the trigger named update_salary, you would execute: ALTER TRIGGER update_salary DISABLE; This statement will prevent the trigger from firing until it is explicitly enabled again using the ENABLE option: ALTER TRIGGER update_salary … Read more

What is the usage of WHEN clause in trigger?

A WHEN clause specifies the condition that must be true for the trigger to be triggered. In PL/SQL triggers, the WHEN clause is used to specify a condition under which the trigger should be fired. The WHEN clause allows you to define a condition that, when true, activates the trigger and executes its associated trigger … Read more