Null statement-sequential control, PL-SQL Programming

NULL Statement

The NULL statement clearly specifies in action; it does nothing other than to pass control to the next statement. It can, though, improve the readability. In a construct allowing the substitute actions, the NULL statements serve as a placeholder. It tells the readers that the related alternative has not been overlooked, but required that no action is necessary. In the following illustration, the NULL statement shows that no action is taken for the unnamed exceptions:


EXCEPTION
WHEN ZERO_DIVIDE THEN
ROLLBACK;
WHEN VALUE_ERROR THEN
INSERT INTO errors VALUES...
COMMIT;
WHEN OTHERS THEN
NULL;
END;


Each of the clause in an IF statement should contain at least one executable statement. The
NULL statement is executable; therefore you can use it in clauses that correspond to the circumstances in which no action is taken. In the following illustration, the NULL statements emphasize that only top-rated employees get bonus:


IF rating > 90 THEN
compute_bonus(emp_id);
ELSE
NULL;
END IF;


The NULL statement is also a handy way to create stubs when designing the applications from the top down. A stub is dummy subprogram that permits you to defer the definition of a procedure or function till you test and debug the main program. In the following illustration, the NULL statement meets the requirement that at least one statement should appear in the executable part of a subprogram:




PROCEDURE debit_account (acct_id INTEGER, amount REAL) IS
BEGIN
NULL;
END debit_account;

Posted Date: 10/3/2012 6:23:26 AM | Location : United States







Related Discussions:- Null statement-sequential control, Assignment Help, Ask Question on Null statement-sequential control, Get Answer, Expert's Help, Null statement-sequential control Discussions

Write discussion on Null statement-sequential control
Your posts are moderated
Related Questions
Exception handling In the PL/SQL, a warning or error condition is known as an exception. The Exceptions can be internally defined (by the run-time system) or user defined. The

Using INNER JOIN INNER JOIN is used to retrieve the data from all tables listed based on a condition of equality listed after keyword ON. If the condition is not meet, rows ar

Difference between 9i & 10G When Oracle releases any new databases then it are having some discrepancy with them. But 10G is having much difference than oracle 9i has. Oracle

Project Description: This is stage 1 of a larger conversion project. We are converting a traditional Server/Client application written in Access 2007 into a web interface with S

What Is a Package? The package is a schema object that group logically related PL/SQL items, types, and subprograms. The Packages usually have 2 parts, a specification & a bo

Table Represents an Extension - SQL It describes how each tuple in a relation represents a true instantiation of some predicate and each true instantiation is represented by s

How Transactions Guard Your Database The transaction is a sequence of SQL data manipulation statements which does a logical unit of work. The Oracle treats the sequence of SQL

Transactions in SQL BEGIN TRANSACTION, COMMIT, and ROLLBACK, SQL has the same syntax except for START in place of BEGIN. However, START TRANSACTION is used only for outermost

Implicit Cursor Attributes The Implicit cursor attributes returns the information about the execution of an INSERT, DELETE, UPDATE, or SELECT INTO statement. The cursor attribu

Advantages of Subprograms The Subprograms give extensibility; that is, tailor the PL/SQL language to suit your requirements. For illustration, if you require a procedure which