27 June, 2015

PLSQL Interview Questions - Set 1

Set of PL/SQL Interview Questions


1. Difference between 
  • DROP and TRUNC[ATE] - truncate is faster as it is autocommit and does not fire any delete triggers. But delete does this, so it is slow.
  • NVL and NVL2 - nvl2 takes 3 arguments
  • UNION and UNIONALL - union removes the duplicates, but unionall shows duplicate records too. Performance of unionall is better as it does not have the overhead to remove duplicates.

2. PRAGMA
Compiler directive or call it a hint. Can be used with database triggers, top level anonymous block, local standalone procedures and functions.
Topic Explained

3. INSTEAD OF trigger
Create updatable views using instead of triggers.

4. Dynamic SQL
This functionality allows us to build and execute dynamic sql at runtime.
That means when the code is compiled, the compiler does not know what the dynamic statement would be.
as compiler checks beforehand about the statis sql for valid privileges and db references, so its fast compared to dynamic.

Author's Message