Home / Interview / PL/SQL :: General Questions

Interview :: PL/SQL

21) What happens when a trigger is associated to a view?

When a trigger is associated to a view, the base table triggers are normally enabled.

22) 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.

23) How to disable a trigger name update_salary?

ALTER TRIGGER update_salary DISABLE;

24) Which command is used to delete a trigger?

DROP TRIGGER command.

25) 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.

26) 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.

27) What are the different schemas objects that can be created using PL/SQL?
  • Stored procedures and functions
  • Packages
  • Triggers
  • Cursors
28) What do you know by PL/SQL Cursors?

Oracle uses workspaces to execute the SQL commands. When Oracle processes a SQL command, it opens an area in the memory called Private SQL Area. This area is identified by the cursor. It allows programmers to name this area and access it?s information.

29) What is the difference between the implicit and explicit cursors?

Implicit cursor is implicitly declared by Oracle. This is a cursor to all the DDL and DML commands that return only one row.

Explicit cursor is created for queries returning multiple rows.

30) What will you get by the cursor attribute SQL%ROWCOUNT?

The cursor attribute SQL%ROWCOUNT will return the number of rows that are processed by a SQL statement.