Collections:
Define Variables before Procedures and Functions in Oracle
What Is the Order of Defining Local Variables and Sub Procedures/Functions in Oracle?
✍: FYIcenter.com
In the declaration part, you must define all local variables before defining any sub procedures or sub functions. See the following sample script:
SQL> CREATE OR REPLACE PROCEDURE WELCOME AS
2 SITE CHAR(80) := 'FYICenter';
3 PROCEDURE WELCOME_PRINT(S CHAR) AS
4 BEGIN
5 DBMS_OUTPUT.PUT_LINE('Welcome to ' || S);
6 END;
7 BEGIN
8 WELCOME_PRINT(SITE);
9 END;
10 /
SQL> EXECUTE WELCOME;
Welcome to FYICenter
Notice that variable SITE should be declared before procedure WELCOME_PRINT
⇒ Formal Parameters and Actual Parameters in Oracle
⇐ Run-Away Recursive Calls in Oracle
2018-03-18, 2216🔥, 0💬
Popular Posts:
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...