PL/SQL Interview Questions

7
PL/SQL Interview Questions www.srinimf.com

Transcript of PL/SQL Interview Questions

Page 1: PL/SQL Interview Questions

PL/SQL Interview Questionswww.srinimf.com

Page 2: PL/SQL Interview Questions

Questions-11. What is PL/SQL Virtual m/c?A. The PL/SQL virtual machine (PVM) is a memory-to-memory structure specifically designed for PL/SQL. When a

program unit (PL/SQL stored object or anonymous block) whose code type is interpreted is executed, the PVM receives the MCode instructions, and interprets them for use in the local environment. It communicates the interpreted instructions to the RDBMS kernel. When using NCOMP, the PVM has to do less, but is still involved in the execution

2. When we receive compilation error?A. PL/SQL program units are compiled when they're created. The part that can be easily seen is the syntax and

dependency check that's performed. If a dependent object doesn't exist, or is invalid, a compilation error message is returned.

3. How many errors we will get during PL/SQL code development?A. One compile time error, and the other one is run time errors.

Page 3: PL/SQL Interview Questions

Questions-24. When do compile time errors happen?

A. Compile time exceptions or errors happen when you attempt to run your anonymous PL/SQL program or store a PL/SQL program as a stored function, procedure, or package. Compile time exceptions also occur when running SQL statements. Both of these types of errors are trapped and raised by one of two parsers. The SQL errors are caught by the SQL parser and the PL/SQL errors are caught by the PL/SQL parser.

5. Which syntax first it will check SQL/PLSQL?A. PL/SQL syntax is always checked before SQL syntax. Only when the PL/SQL syntax is semantically correct will

SQL syntax errors be shown when attempting to run an anonymous or named block PL/SQL program.6. What is exception handling in Oracle PL/SQL?

A. As a beginning or experienced PL/SQL developer, you learned the PL/SQL block structure. This section is most likely a review for most PL/SQL programmers. The EXCEPTION block is the key for managing exceptions, while the DECLARE block is where you put user-defined exceptions. The BEGIN block is where your program encounters an error, raises an exception, and passes control to its local EXCEPTION block or an external PL/SQL EXCEPTION block.

Page 4: PL/SQL Interview Questions

Questions-37. What is error stack in PL/SQL?

A. The error stack is the sequencing of errors from the triggering event to the calling block of code. PL/SQL throws an exception in the BEGIN block when a failure occurs and runs the code in its local EXCEPTION block. If the failure is in a nested or referenced PL/SQL block, it first runs a local EXCEPTION block before running the calling program unit's EXCEPTION block. It then continues running available EXCEPTION code blocks or returning errors to the error stack until it returns control to the outermost PL/SQL block.

8. How many errors we will receive in Database Triggers?A. Database triggers have two behavioral patterns. One is for a critical error, which is similar to everything we

covered in the previous examples. Another is for a non- critical error. A noncritical error may be a security or audit issue. These may include unauthorized updates to tables and views. When they happen, you should store the transaction data in a way that is transparent to the user or hacker executing the transaction. This requires a different approach to error stack management.

B. Triggers are event driven programs

Page 5: PL/SQL Interview Questions

Questions-49. How triggers call other stored procedures?

A. Triggers are activated when a transactional program unit calls a database object, like a table or view. Database triggers

may sometimes call other stored functions, procedures, and packages. When triggers call other stored objects, those

program units cannot contain any transaction control language (TCL) commands, like SAVEPOINT, ROLLBACK, and

COMMIT

10. What is an object in Oracle?

A. An Oracle object type is a structure that is user-defined. The structure may be used as a user-defined type when building a

table, passing a formal parameter, or returning a complex structure from a stored function. Like a stored package, an object

has a specification and a body. The specification declares the structure of the object and the body provides the object

type's implementation.

11. What are the different types of objects in Oracle?

A. Tables, views, stored packages, stored procedures, and so on, are all objects. Objects are likewise schema objects. This

means they act similar to other schema objects, but their closest cousin is a stored package.

Page 6: PL/SQL Interview Questions

Questions-512. What is instantiating an object?

A. Instantiating a variable is like initializing a variable except with one difference. When you initialize a variable, you assign the right-hand variable of the same type to the left-hand target. Instantiating an object type, you must call the constructor and provide actual parameters if required by the constructor function

Page 7: PL/SQL Interview Questions

Thank You

www.srinimf.com