0% found this document useful (0 votes)
17 views

Basic Code Structure: PL/SQL (Procedural Language/Structured Query Language) Is Oracle Corporation's

PL/SQL is Oracle Corporation's proprietary procedural extension to SQL that is used in the Oracle database. It has a basic code structure that includes a declaration block, program block, and exception handling block. PL/SQL provides several looping constructs for iteration, including basic LOOP statements, WHILE loops, FOR loops, and Cursor FOR loops. A basic LOOP statement syntax example is shown to repeatedly output the incrementing value of an integer variable.

Uploaded by

Debjyoti Dutta
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Basic Code Structure: PL/SQL (Procedural Language/Structured Query Language) Is Oracle Corporation's

PL/SQL is Oracle Corporation's proprietary procedural extension to SQL that is used in the Oracle database. It has a basic code structure that includes a declaration block, program block, and exception handling block. PL/SQL provides several looping constructs for iteration, including basic LOOP statements, WHILE loops, FOR loops, and Cursor FOR loops. A basic LOOP statement syntax example is shown to repeatedly output the incrementing value of an integer variable.

Uploaded by

Debjyoti Dutta
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's

proprietary procedural extension to the SQL database language, used in the Oracle
database.

Basic code structure


DECLARE
-- Declaration block (optional)
BEGIN
-- Program proper
EXCEPTION
-- Exception-handling (optional)
END
/* Sample comment spanning
multiple lines... */

Looping
As a procedural language by definition, PL/SQL provides several iteration constructs,
including basic LOOP statements, WHILE loops, FOR loops, and Cursor FOR loops.

[edit] LOOP statements

Syntax:

LOOP
statement1;
statement2;
END LOOP;

Example:

DECLARE

X INT:=0;
BEGIN

WHILE X<100
LOOP
X:=X+1;
DBMS_OUT.PUT_LINE(X); ///output statement
END LOOP;
END;

You might also like