Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What Are Named Parameters?

named parameters
0
10 Posted

What Are Named Parameters?

0

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 AS2 A NUMBER := 3;3 B NUMBER := 8;4 PROCEDURE MY_SWAP(X IN OUT NUMBER, Y IN OUT NUMBER) AS5 T NUMBER;6 BEGIN7 T := X;8 X := Y;9 Y := T;10 END MY_SWAP;11 BEGIN12 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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.