Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Procedures and DEFAULT values for parameters
Martijn Tonies wrote:
> *g* ... ok - so defaults work.
>
> However, the Oracle documentation doesn't mention them in CREATE
PROCEDURE:
> CREATE [ OR REPLACE ] PROCEDURE [ schema. ]procedure
> [ (argument [ IN | OUT | IN OUT ]
> [ NOCOPY ]
> datatype
> [, argument [ IN | OUT | IN OUT ]
> [ NOCOPY ]
> datatype
> ]...
> )
> ]
> [ invoker_rights_clause ]
> { IS | AS }
> { pl/sql_subprogram_body | call_spec }
>
> Where exactly would they fit in?
>
> After "datatype"?
Like this:
SQL> create or replace
2 procedure p (x in number default 1)
3 is
4 begin
5 dbms_output.put_line('x = '||x);
6 end;
7 /
Procedure created.
SQL> exec p
x = 1
PL/SQL procedure successfully completed.
The DEFAULT clause is documented in the PL/SQL Reference since at least 8.1.7:
http://download-west.oracle.com/docs/cd/A87860_01/doc/appdev.817/a77069/11_elems.htm#11839
... but NOT in the SQL Reference for some reason, even in the 10G docs!
http://download-west.oracle.com/docs/cd/B12037_01/server.101/b10759/statements_6009.htm#sthref5190 Received on Mon Nov 01 2004 - 09:16:44 CST
![]() |
![]() |