Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What Is the Scope of a Local Variable
What Is the Scope of a Local Variable? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions
✍: FYIcenter.com
The scope of a variable can be described with these rules:
Here is a sample script to show you those rules:
The script below illustrates how to use named parameters:
SQL> CREATE OR REPLACE PROCEDURE PARENT AS
2 X CHAR(10) := 'FYI';
3 Y NUMBER := 999999.00;
4 PROCEDURE CHILD AS
5 Y CHAR(10) := 'CENTER';
6 Z NUMBER := -1;
7 BEGIN
8 DBMS_OUTPUT.PUT_LINE('X = ' || X); -- X from PARENT
9 DBMS_OUTPUT.PUT_LINE('Y = ' || Y); -- Y from CHILD
10 DBMS_OUTPUT.PUT_LINE('Z = ' || TO_CHAR(Z));
11 END;
12 BEGIN
13 DBMS_OUTPUT.PUT_LINE('X = ' || X); -- X from PARENT
14 DBMS_OUTPUT.PUT_LINE('Y = ' || TO_CHAR(Y));
15 -- DBMS_OUTPUT.PUT_LINE('Z = ' || TO_CHAR(Z));
16 CHILD;
17 END;
18 /
SQL> EXECUTE PARENT;
X = FYI
Y = 999999
X = FYI
Y = CENTER
Z = -1
2007-04-21, 5766👍, 0💬
Popular Posts:
What Information Is Needed to Connect SQL*Plus an Oracle Server? - Oracle DBA FAQ - Introduction to ...
Can we have shared events ? Yes, you can have shared event’s note only shared methods can raise shar...
What Happens If a Hyper Link Points to a Music File? - XHTML 1.0 Tutorials - Understanding Hyper Lin...
How does one iterate through items and records in a specified block? One can use NEXT_FIELD to itera...
How To Download and install PSP Evaluation? - PSP Tutorials - Fading Images to Background Colors wit...