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, 5547👍, 0💬
Popular Posts:
If client side validation is enabled in your Web page, does that mean server side code is not run? W...
What is the difference between Class and structure’s ? Following are the key differences between the...
What does a special set of tags <?= and ?> do in a PHP script page? <?= express...
Does there exist any other function which can be used to convert an integer or a float to a string? ...
What Happens If One Row Has Missing Columns? - XHTML 1.0 Tutorials - Understanding Tables and Table ...