The PL/SQL also called procedural language SQL interview questions. These are very useful to prepare for interviews and also you can use to conduct interviews.
- What is mutating table error?
- For a trigger, it is the table on which this trigger is defined. If a trigger tries to read or modify such a table, it causes a mutating table error.
- What is compound trigger?
- It is a solution for Mutating table error. Introduced in 11g
- What will happen if set serveroutput off?
- It will not write o/p to the screen
- What are labels ?
- Lables can be used in PL/SQL block to improve redability.
- SET SERVEROUTPUT ON<< find_stu_num >>
BEGIN
DBMS_OUTPUT.PUT_LINE(‘The procedure
find_stu_num has been executed.’);
END find_stu_num;
- What is nested if?
- If within the If is called nested if.
- Difference between NULLIF and COALESCE ?
- NULLIF(exp1, exp2) => if both are equal it writes NULL. Else it writes first 1 & COLAESCE(exp1,exp2…) => It writes first non-null expression
- ‘REVERSE’ in FOR loop?
- It iterates from higher value to lower value
- What is anonymous block and named block?
- Anonymous block is not stored in the server. So we can not re-use it. Named block we can use it later.
- FOR UPDATE and WHERE CURRENT OF ?
- The FOR UPDATE and WHERE CURRENT OF syntax can be used with cursors that are performing a delete as well as an update.
- How many pkgs oracle is having?
- More than 130 pkgs.
Related articles
- PL/SQL – Complex Queries (Job Interviews) (srinimf.com)
- Trigger for insert after (stackoverflow.com)