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 Are Named Parameters
What Are Named Parameters? - Oracle DBA FAQ - Creating Your Own PL/SQL Procedures and Functions
✍: FYIcenter.com
Named parameters are actual parameters specified not by position but by providing formal parameter names when calling the procedure or function. The main advantage of named parameters is that the caller don't have to remember the position of each parameter. But the caller have to remember the formal parameter names. The script below illustrates how to use named parameters:
SQL> CREATE OR REPLACE PROCEDURE SWAP_TEST AS
2 A NUMBER := 3;
3 B NUMBER := 8;
4 PROCEDURE MY_SWAP(X IN OUT NUMBER,Y IN OUT NUMBER) AS
5 T NUMBER;
6 BEGIN
7 T := X;
8 X := Y;
9 Y := T;
10 END MY_SWAP;
11 BEGIN
12 MY_SWAP(Y=>B, X=>A); -- same as (X=>A, Y=B), OR (A,B)
13 DBMS_OUTPUT.PUT_LINE('A = ' || TO_CHAR(A));
14 DBMS_OUTPUT.PUT_LINE('B = ' || TO_CHAR(B));
15 END;
16 /
SQL> EXECUTE SWAP_TEST;
A = 8
B = 3
2007-04-21, 7062👍, 0💬
Popular Posts:
What are the different elements in Functions points? The different elements in function points are a...
What is triple constraint triangle in project management ? Project Management triangle is depicted a...
What is Service Oriented architecture? “Services” are components which expose well defined interface...
How To Increment Dates by 1? - Oracle DBA FAQ - Understanding SQL Basics If you have a date, and you...
Can a variable be both const and volatile? Yes. The const modifier means that this code cannot chang...