Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle NULL vs '' revisited
On Aug 18, 3:06 am, Matthew Harrison <m.harris..._at_craznar.com> wrote:
> zigzag..._at_yahoo.com wrote:
> >It has always worked for me. Oracle may have messed up
> > things but if a disciplined approach by keeping null indicator
> > separate from the actual value is followed all through the code,
> > things will still work.
>
> So , I have a stored proc with a parameter MSG.
>
> I have a table with values MSG and MSGISNULL.
>
> How do I tell the parameter is '' or NULL ?
>
> Or does the client user have to pass two parameters and do the test in
> their own langauge.
>
> The catch here is that if it was a number, I just wouldn't put a value
> in ... that is ... the stored procedure would not have been called.
>
> So - how do I detect, and act on someone NOT calling the stored
> procedure and set a flag ?
>
Perhaps some demo code would make the scenario clearer.
If myproc() takes an argument with a default of NULL, you can distinguish between
myproc()
and
myproc(NULL)
by using overloading. I'm not sure that is your scenario though. You may also be able to do something with CHAR variables (normally considered evil for this sort of reason). Received on Mon Aug 20 2007 - 11:03:35 CDT