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:
How To Define Default Values for Formal Parameters
How To Define Default Values for Formal Parameters? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions
✍: 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
2007-04-21, 5248👍, 0💬
Popular Posts:
1. What is normalization. 2. Difference between procedure and functions. 3. Oracle 9i Vs 10g. 4. how...
How do we enable SQL Cache Dependency in ASP.NET 2.0? Below are the broader steps to enable a SQL Ca...
What is normalization? What are different types of normalization? It is set of rules that have been ...
How To Write a Query with a Right Outer Join? - Oracle DBA FAQ - Understanding SQL SELECT Query Stat...
What is the difference between Authentication and authorization? This can be a tricky question. Thes...