Sequential Control Statements

PL/SQL provides a GOTO statement and a NULL statement to aid in sequential control operations.The structure of PL/SQL is such that the GOTO statement is rarely needed. The NULL statement improve the readability of PL/SQL code by making the meaning and action of conditional statements clear.

Overuse of GOTO statements can result in complex, unstructured code that is hard to understand and maintain. So, use GOTO statements sparingly.

GOTO Statement

The GOTO statement performs unconditional branching to a named Label in the program.Label should contain at least one executable statement.

syntax is as follows:

GOTO label_name;

Label_name is the name of the label created with the syntax
<<LABEL_NAME>>

Read More about GOTO Statement

NULL Statement

The NULL statement is an executable statement.But as it’s name implies NULL statement that does nothing. It is useful when an executable statement must follow

Example:

IF JOB_TYPE = ‘ACC’ THEN

DBMS_OUTPUT.PUT_LINE(‘Job Category:Accounting’);

ELSE

NULL;

END IF;

1 comment

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com Jimmy Leaks
#1. July 21st, 2010, at 4:39 PM.

Thanks for sharing this information. I’m always looking for great resources to share with clients and my colleagues, and this article is certainly worth sharing!

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




CAPTCHA Image CAPTCHA Audio
Refresh Image

You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .