2009년 8월 16일 일요일

Argument 명시적 선택

SQL> create or replace procedure p6(

2 a1 number default 1,

3 a2 number default 2,

4 a3 number default 3,

5 a4 number default 4,

6 a5 number)

7 as

8 begin

9 dbms_output.put_line((a1+a2+a3+a4+a5));

10 end;

11 /

   

Procedure created.

   

SQL> exec p6(null,null,null,null,5);

   

PL/SQL procedure successfully completed.

   

SQL> exec p6(1,2,3,4,5);

15

   

PL/SQL procedure successfully completed.

   

SQL> exec p6(a5=>5);

15

   

PL/SQL procedure successfully completed.

   

SQL> exec p6(a5=>5,a3=>6);

18

   

PL/SQL procedure successfully completed.

댓글 없음:

댓글 쓰기