Config Router

  • Google Sheets
  • CCNA Online training
    • CCNA
  • CISCO Lab Guides
    • CCNA Security Lab Manual With Solutions
    • CCNP Route Lab Manual with Solutions
    • CCNP Switch Lab Manual with Solutions
  • Juniper
  • Linux
  • DevOps Tutorials
  • Python Array
You are here: Home / Interview Questions / Packages & Triggers – ORACLE PL/SQL Chapter Wise Interview Questions

Packages & Triggers – ORACLE PL/SQL Chapter Wise Interview Questions

February 23, 2020 by Scott

Packages & Triggers – ORACLE PL/SQL Chapter Wise Interview Questions

Question 1:
What is a package spec and package body? Why the separation?
Answer:

  1. Spec declares public constructs. Body defines public constructs, additionally declares and defines Private constructs
  2. Separation helps make development easier
  3. Dependency is simplified. You can modify body without in validating dependent objects.

Question 2:
What are the advantages of Packages?
Answer:

  1. Encapsulation of code logic
  2. Privileges to objects can be controlled
  3. Loaded once into memory, used subsequently.
  4. Dependency simplified
  5. Public/private procs, functions, variables

Question 3:
What are Triggers? How to invoke a Trigger on demand?
Answer:
Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE or DELETE operation takes place on a table. Triggers can’t be invoked on demand. They get triggered only when an associated action (INSERT, UPDATE, and DELETE) happens on the table on which they are defined. Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.

Question 4:
What are the different types of Triggers?
Answer:
There are 12 types of triggers in PL/SQL that consist of combinations of the BEFORE, AFTER, ROW, TABLE, INSERT, UPDATE, DELETE and row level and statement level triggers

Row level:
BEFORE INSERT FOR EACH ROW
BEFORE UPDATE FOR EACH ROW
BEFORE DELETE FOR EACH ROW
AFTER INSERT FOR EACH ROW
AFTER UPDATE FOR EACH ROW
AFTER DELETE FOR EACH ROW

Statement level:
BEFORE INSERT
BEFORE UPDATE
BEFORE DELETE
AFTER INSERT
AFTER UPDATE
AFTER DELETE

Question 5:
What is the maximum number of statements that can be specified in a trigger statement?
Answer:
One.

Question 6:
Can views be specified in a trigger statement?
Answer:
No

Question 7:
What are the values of: new and: old in Insert/Delete/Update Triggers?
Answer:
INSERT; new = new value, old = NULL
DELETE: new = NULL, old = old value
UPDATE: new = new value, old = old value

Question 8:
What are Cascading Triggers? What is the maximum no of Cascading Triggers at a time?
Answer:
When a statement in a Trigger body causes another Trigger to be fired, the Triggers are said to be Cascading. Max = 32.

Question 9:
What are Mutating Triggers?
Answer:
A Trigger giving a SELECT on the table on which the Trigger is written.

Question 10:
What are Constraining Triggers?
Answer:
A Trigger giving an Insert/Update on a table having referential integrity constraint on the triggering table.

Question 11:
What is the maximum number of triggers, can apply to a single table?
Answer:
12 Triggers.

Question 12:
Can database trigger written on synonym of a table and if it can be then what would be the effect if original table is accessed.
Answer:
Yes, database trigger would fire.

Question 13:
Give a PL/SQL command to delete a Trigger?
Answer:

SQL>DROP TRIGGER trigger_name;

Related

Filed Under: Interview Questions Tagged With: ORACLE PL/SQL Chapter Wise Interview Questions, Packages & Triggers

Recent Posts

  • How do I give user access to Jenkins?
  • What is docker volume command?
  • What is the date format in Unix?
  • What is the difference between ARG and ENV Docker?
  • What is rsync command Linux?
  • How to Add Music to Snapchat 2021 Android? | How to Search, Add, Share Songs on Snapchat Story?
  • How to Enable Snapchat Notifications for Android & iPhone? | Steps to Turn on Snapchat Bitmoji Notification
  • Easy Methods to Fix Snapchat Camera Not Working Black Screen Issue | Reasons & Troubleshooting Tips to Solve Snapchat Camera Problems
  • Detailed Procedure for How to Update Snapchat on iOS 14 for Free
  • What is Snapchat Spotlight Feature? How to Make a Spotlight on Snapchat?
  • Snapchat Hack Tutorial 2021: Can I hack a Snapchat Account without them knowing?

Copyright © 2025 · News Pro Theme on Genesis Framework · WordPress · Log in