Collections:
Define Default Values for Formal Parameters in Oracle
How To Define Default Values for Formal Parameters in Oracle?
✍: FYIcenter.com
If you have an IN parameter, you can make it as an optional parameter for the calling statement by defining the formal parameter with the DEFAULT clause. This gives you the freedom of not providing the actual parameter when calling this procedure or function. See the following tutorial script shows you an example procedure with an optional parameter:
SQL> CREATE OR REPLACE PROCEDURE WELCOME AS
2 PROCEDURE GREETING(S IN CHAR DEFAULT 'FYICenter') AS
3 BEGIN
4 DBMS_OUTPUT.PUT_LINE('Welcome to ' || S);
5 END;
6 BEGIN
7 GREETING('MySpace.com');
8 GREETING;
9 END;
10 /
Procedure created.
SQL> EXECUTE WELCOME;
Welcome to MySpace.com
Welcome to FYICenter
⇒ What Are Named Parameters in Oracle
⇐ Use "IN OUT" Parameters in Oracle
2018-10-19, 2586🔥, 0💬
Popular Posts:
How To Start MySQL Server in MySQL? If you want to start the MySQL server, you can run the "mysqld" ...
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...
How to set database to be READ_ONLY in SQL Server? Databases in SQL Server have two update options: ...
How To Present a Past Time in Hours, Minutes and Seconds in MySQL? If you want show an article was p...