View Single Post

   
  #1 (permalink)  
Old 04-07-2008, 11:01 PM
kevin Sedota
 
Posts: n/a
Default problems with default parameter values

using Oracle 10g (maybe others, I don't know)
Writing Stored procs which have default values.

I had a bunch of code that had parameter definitions that looked like:

p1 in varchar2 := null,
p2 in number := null

These worked fine when the parameter was a varchar but for anything else it
would not work. I'm not sure what was being passed.
However if I coded

p1 in varchar2 DEFAULT null,
p2 in number DEFAULT null

everything worked fine. The documentation states that := should be use for
defining default numerics. something like

p2 in number := 7

which would seem to imply that null in place of 7 should be ok. But it's
not.

Is this an error in the documentation?

thanks

kjs


Reply With Quote