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, 5672👍, 0💬
Popular Posts:
How Do You Uninstall JUnit Uninstalling JUnit is easy. Just remember these: Delete the directory tha...
Do You Know the Book "JUnit in Action"? You should know this book. It received some good reviews. Ti...
How is normally a project management plan document organized ? PMP document forms the bible of a pro...
How To Create Nested Tables? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells You can cr...
How To Divide Query Output into Groups? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY You...