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
Positional and Named Notation You can write the actual parameters when calling a subprogram, using either positional or named notation. That is, you can point to the relationsh

Using EXTEND To enlarge the size of a collection, use EXTEND. This process has 3 forms. The EXTEND appends one null element to a collection. And the EXTEND(n) appends n null e

THEO R Y OF ETERNITY OF LIFE (PRAYER - 1880) - The theory of eternity of life, also called the steady-state theory , states that life has ever been in existence as at presen

Table Literals - SQL One might expect SQL to support table literals in the manner illustrated in Example 2.2, but in fact that is not a legal SQL expression. Example: Not a

Parameter Modes   To define the behavior of formal parameters you use the parameter modes. The 3 parameter modes, IN, OUT, & IN OUT, can be used with any subprogram. Though, a

What Are Subprograms? The Subprograms are named PL/SQL blocks which can take parameters and be invoked. The PL/SQL has 2 types of subprograms known as the procedure s and func

IS NULL Operator The IS NULL operator returns the Boolean value TRUE whenever its operand is null or FALSE if it is not null. The comparisons including the nulls always yield NU

Many of the reports generated from the system calculate the total dollars in a shopper''s purchases. Follow these steps to create a function named TOT_PURCH_SF that accepts a shopp

Logical Operators The logical operators AND, NOT, and OR follow the tri-state logic shown in table below. The AND and OR are binary operators; NOT is a unary operator.

This is a Customer Management project. Customer data is presented in a text file. The program will load this text data into its DB columns. The data mapping is user definable. User