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, 5866👍, 0💬
Popular Posts:
Can we have shared events ? Yes, you can have shared event’s note only shared methods can raise shar...
What’ is the sequence in which ASP.NET events are processed ? Following is the sequence in which the...
What is Native Image Generator (Ngen.exe)? The Native Image Generator utility (Ngen.exe) allows you ...
Can you please post OpenLink Endur related FAQ's,tutorials,document s.Thanks
How To Export Data to a CSV File? - Oracle DBA FAQ - Introduction to Oracle SQL Developer If you wan...