Professional Documents
Culture Documents
HT T P: // SQL - PL SQL - BL Ogspot - C Om / HT T P: // SQL - PL SQL - BL Ogspot - C Om
HT T P: // SQL - PL SQL - BL Ogspot - C Om / HT T P: // SQL - PL SQL - BL Ogspot - C Om
c om /
For more on SQL & PL/SQLht t p: // sql - pl sql . bl ogspot . c om /
What special operators does Oracle provide for dealing with NULLs?
You can use this syntax to check specifically to see if a variable's value is NULL or NOT NULL.
Explain three different rules that apply to NULLs when doing comparisons?
1. For all operators except for concatenation (||), if a value in an expression is a NULL, that
A function has a return type in its specification and must return a value specified in that type. A procedure does not
have a return type in its specification and should not return any value, but it can have a return statement that
simply stops its execution and returns to the caller.
The compilation process includes syntax checking, binding, and p-code generation. Syntax
checking involves checking PL/SQL code for compilation errors. After syntax errors have been
corrected, a storage address is assigned to the variables that are used to hold data for Oracle.
This process is called binding. Next, p-code is generated for the PL/SQL block. P-code is a list of
instructions to the PL/SQL engine. For named blocks, p-code is stored in the database, and it is
used the next time the program is executed.
BEIN
DBMS_OUTPUT.PUT_LINE ('This is a test');
END;
contains a syntax error. Try to find it.
A SELECT INTO statement returning no rows is an example of a runtime error. This error can be
handled with the help of the exception-handling section of the PL/SQL block.
When a ROLLBACK statement is issued to the database, the transaction has ended, and the
The ROLLBACK statement undoes all the work done by the user in a specific transaction. With
the SAVEPOINT command, however, only part of the transaction can be undone.
Explain Implicit and Explicit cursors
Oracle automatically declares an implicit cursor every time a SQL statement is executed. The
user is unaware of this and cannot control or process the information in an implicit cursor.
The program defines an explicit cursor for any query that returns more than one row of data. This
means that the programmer has declared the cursor within the PL/SQL code block. This
declaration allows the application to sequentially process each row of data as the cursor returns
it.
1. Any given PL/SQL block issues an implicit cursor whenever a SQL statement is
executed, as long as an explicit cursor does not exist for that SQL statement.
2. A cursor is automatically associated with every DML (data manipulation) statement
2. Opening the cursor. The declared cursor is opened, and memory is allotted.
Too_many_rows,
No_Data_Found,
Value_Error,
Zero_Error,
Others
This happens with triggers. It occurs because the trigger is trying to update a row it is currently
using. The usual fix involves either use of views or temporary tables so the database is selecting
from one while updating the other.
What packages (if any) has Oracle provided for use by developers?
Oracle provides the DBMS_ series of packages. There are many which developers should be
aware of such as DBMS_SQL, DBMS_PIPE, DBMS_TRANSACTION, DBMS_LOCK,
DBMS_ALERT, DBMS_OUTPUT, DBMS_JOB, DBMS_UTILITY, DBMS_DDL, UTL_FILE. If they
can mention a few of these and describe how they used them, even better. If they include the
SQL routines provided by Oracle, great, but not really what was asked.