Subject Re: Using Null as parameter in Stored Procedure
Author todd_pinel
--- In, "Martijn Tonies"
<m.tonies@u...> wrote:
> > >The weird thing is that I am using IBExpert to create and edit
all my
> > >FireBird psql, and when I use the built-in debugger I am able
to walk
> > >through my code and view the results that I am expecting.
> >
> > Debuggers don't execute the SP code, so you won't see run-time
> > during debugging.
> Or, it does show runtime errors but the debugger has a bug in
> NULLs and automatically converts the SQL statement to IS NULL
> instead of doing the = NULL like the procedure is doing :-)
> You might want to check IBExperts SQL trace for this.
> With regards,
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird, MySQL
> Server.
> Upscene Productions

I think I perhaps didn't explain whats going on well enough:)

I have 4 sp's nested within eachother and when I trace down to the
3rd level sp (which in the problem case is passed a null in an input
parameter) the debugger shows me the correct result, say its $10.
But when it exits and jumps back up to the 2nd sp this value is lost
and I have $0 which is incorrect. This only happens when I have
null being passed in as an input parameter. I have been using
IBExpert for almost 2 years now and I have never had too many issues
with it, I have found its debugger to be quite reliable and in my
mind it is showing me exactly whats happening at run time. For some
reason my 3rd sp collects the expected result on a null parameter
but when its called from within the second sp it returns a 0. I
should also add that I have nested these sp's so that I can call
each one seperately from other places in my program and if I call
the 3rd sp using a null parameter from isql IBExpert and IBConsole
reutrn the $10 that I expect. This is why I was wondering if there
is maybe some issue when passing a null into a sp? Thanks for all
the input, this news group is really awesome. Todd.