December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want to reference a block of code within a code segment later in your program.
Assign a label to the block of code that you want to reference. A PL/SQL label consists of a unique identifier surrounded by double angle brackets. For example, in the following code, you see that the block has been labeled dept_block:
<<dept_block>>
DECLARE
dept_name varchar2(30);
BEGIN
SELECT department_name
INTO dept_name
FROM departments
WHERE department_id = 230;
DBMS_OUTPUT.PUT_LINE(dept_name);
END;
This code block can now be referenced by the label dept_block. See Recipe 1-9 for one example of code block labels.
Any block of code can be labeled with a unique identifier for readability ...
Read now
Unlock full access