Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Procedures and DEFAULT values for parameters

Re: Stored Procedures and DEFAULT values for parameters

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Mon, 01 Nov 2004 19:42:13 -0800
Message-ID: <1099366868.241185@yasure>


Martijn Tonies wrote:

> Hello Tony,
>
>

>>>I cannot seem to figure out if a procedure parameter
>>>can have a default value, eg something like:
>>>
>>>create procedure def_test (pin_1 int default 4)
>>>as
>>>...
>>><stuff>
>>>
>>>It seems to compile, but...
>>>
>>>If this is accepted, the default value doesn't seem to
>>>show up in  ALL_ARGUMENTS.DEFAULT_VALUE
>>>
>>>Any idea what I'm doing wrong, if anything?
>>>
>>>I seem to remember that this could be done...
>>
>>It can be done, your code is OK.  The problem is that the DEFAULT_VALUE
>>column in ALL_ARGUMENTS doesn't work!

>
>
> *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"?
>
> [DEFAULT default_value]
>
> ?

Go to http://www.psoug.org
click on Morgan's Library
click on Procedures

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Mon Nov 01 2004 - 21:42:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US