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
Procedural Constraint Enforcement (Triggers) SQL has an alternative method of addressing database integrity, involving event-driven procedural code. The special procedures th

Opening a Cursor Opening the cursor executes the query & identifies the result set that consists of all rows that meet the query search criteria. For the cursors declared usin

Creating and Destroying Base Tables: Example shows an SQL command to create the base table counterpart of the ENROLMENT variable Example  Creating a base table. CREATE T

%ROWCOUNT When its cursor or cursor variable is opened, the %ROWCOUNT is zeroed. Before the first fetch, the %ROWCOUNT yields 0. Afterward, it yields the number of rows fetche

Referencing Records Unlike the elements in a collection, that are accessed using subscripts, the fields in a record are accessed by name. To reference an individual field, you

Need Azure CRM Web Application with two-factor authentication We presently have a CRM-like database stored on MS Azure that we presently access over an MS Access application. It

Exceptions An exception is the runtime error or warning condition that can be predefined or user-defined. The Predefined exceptions are raised implicitly through runtime system

Implicit Cursors The Oracle implicitly opens a cursor to process each SQL statement not related with an explicitly declared cursor. The PL/SQL lets you refer to the most recen

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean's wants to create a trigger that automatically updates the stock level of all pr

Inner Join We have learned how to retrieve data from one table by using SELECT statement. But, as we have learned, normalized relational databases mean the data is spread betw