Subject: | Bind Length messes up after first prepare |
This is really weird. So if you do a query where the first param is
*shorter* than later params the later params cause undef to be returned.
It's easier to see in code than with words.
#!perl
use strict;
use warnings;
use DBI;
my $dbh =
DBI->connect('DBI:ADO:PROVIDER=sqlncli10;SERVER=tcp:10.6.0.9;MARS
Connection=True;Initial Catalog=CIS_dev;UID=cis_web;PWD=elided;');
#my $dbh = DBI->connect('dbi:ODBC:dsn=CIS;UID=cis_web;PWD=elided;'); #
<-- works no matter what
my $sth = $dbh->prepare(' SELECT exp_date
FROM User_Products
WHERE ( product_name = ? AND user_id = ? )');
#for (qw{PF DMF }) { # <-- returns undef on the second result
for (qw{ DMF PF }) { # <-- works fine
$sth->execute($_, 'wesm');
while (my @row = $sth->fetchrow_array) {
print @row;
}
print "\n";
}
Thanks much!