Hello all,
I am using DBD-ADO (latest version) and DBI 1.14 to connect to MS SQL Server 2000 and
execute a User stored procedure called "Step_Two". I use a hash to hold the parameter
values like this:
if (CONDITION) { $hash{'key'} = undef; }
else { $hash['key'} = 'value'; }
$query = '{call Step_Two(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}';
@placeholders = (..., $hash{'param'}, ....);
$sth = $dbh->prepare($query);
$sth->execute(@placeholders);
if the CONDITION is met, I need the stored procedure to receive a NULL value for the
parameter so that it can update the database with NULL values.
However, if at least one of the parameters is NULL, I get the following error:
DBD::ADO::st execute failed: Can't execute statement '{call Step_Two(?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?)}': Lasterror: -2146824580: OLE exception from "ADODB.Command":
Parameter object is improperly defined. Inconsistent or incomplete information was
provided. Win32::OLE(0.1501) error 0x800a0e7c in METHOD/PROPERTYGET "Execute"
undef for a value should translate into NULL, so what am I doing wrong?? HELP!!!!
Thanks!