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, 5946👍, 0💬
Popular Posts:
What will be printed as the result of the operation below: #define swap(a,b) a=a+b;b=a-b;a=a-b; void...
. How can a servlet refresh automatically if some new data has entered the database? You can use a c...
If locking is not implemented what issues can occur? IFollowing are the problems that occur if you d...
What Are the Parameter Modes Supported by PL/SQL? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
What Happens to Your Transactions When ERROR 1213 Occurred? - MySQL FAQs - Transaction Management: C...