PL/SQL Interview Questions and Answers
Prepare for your PL/SQL interviews with these frequently asked questions and comprehensive answers. Covering fundamental concepts to advanced topics.
Frequently Asked PL/SQL Interview Questions
This section provides answers to common PL/SQL interview questions, covering fundamental concepts, transactions, cursors, and error handling. It's designed to be helpful for both beginners and experienced database developers.
PL/SQL Interview Questions and Answers
39) Syntax error vs. runtime error? | A syntax error is detected by the compiler (e.g., typos). A runtime error occurs during program execution (e.g., attempting to access a non-existent row). |
40) What is a COMMIT statement? | Makes database changes permanent and releases any locks held by the transaction. |
41) What is a ROLLBACK statement? | Undoes database changes made within a transaction. |
42) What is a SAVEPOINT statement? | Creates a point within a transaction that allows you to partially rollback changes if needed. |
43) What is a mutating table error? | Occurs when a trigger tries to modify a table it's currently accessing. Use views or temporary tables to resolve this. |
44) What is data consistency? | Ensures that all users see the same, correct data, even during concurrent transactions. |
45) What is a cursor, and why is it used? | A temporary work area in memory used to access and manipulate data retrieved from a database query, one row at a time. |
46) Types of cursors in PL/SQL? | Implicit and explicit cursors. |
What do `%ROWCOUNT`, `%FOUND`, and `%NOTFOUND` do? | `%ROWCOUNT`: Returns the number of rows affected by a DML statement. `%FOUND`: Checks if a cursor fetched any rows. `%NOTFOUND`: Checks if a cursor did *not* fetch any rows. |