[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Passing NULLs to stored procedures...
- Subject: Passing NULLs to stored procedures...
- From: Philip X Harris <harris_philip@JPMORGAN.COM>
- Date: Mon, 24 Nov 1997 07:37:59 +0100
People,
I recently had to wrap an application's stored procedure
with SQR in order to produce a report. The problem was, I only
wanted to pass some of the parameters in with each run of the report.
The stored procedure was written in such a way that NULLs would
be defaulted for any unspecified parameters but in order to not specify
a parameter, the only way I could see was to omit it. This meant creating
a block of code for each possible permutation of input parameters.
Considering
the sheer number of output parameters, this block would have been 100
lines (without the print commands which are in a separate procedure). My
hacky
solution was to wrap the proc in another proc of my own making and
call that with empty strings where I wanted NULLs. This solution is far
from optimal for many reasons. In a nut shell, is there any way of
assigning NULLs
to variables ie:
$var = NULL
To allow:
execute my_proc @var=$var
Any help would be appreciated
Philip