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: phronima <phronima_at_gmail.com>
Date: 1 Nov 2004 17:20:08 -0800
Message-ID: <79791d35.0411011720.533ad6f5@posting.google.com>


I thought the DEFAULT keyword is replaced with the assignment operator? ie x:=1

Correct me if I'm wrong, since I'm new here "Tony Andrews" <andrewst_at_onetel.com> wrote in message news:<1099322204.618241.134530_at_z14g2000cwz.googlegroups.com>...
> 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 - 19:20:08 CST

Original text of this message

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