
ak08820
New User
Oct 18, 2009, 6:56 AM
Post #1 of 2
(252 views)
|
|
DBI Issue - Can't mix placeholder styles
|
Can't Post
|
|
I am trying to debug a script that fails to update a MS Access database. The update statement is as follows.
my($data_bank_date_field) = 'CustomInfo3'; my(%stmt); $stmt{'SetKBBankLastNotifyDate'} = sprintf('UPDATE userdetails SET %s = ? WHERE UserIndex = ?', $data_bank_date_field); The update takes place as follows.
if ($users_to_mail{$_}->{'MailKBBank'}) { eval { $dbh->do($stmt{'SetKBBankLastNotifyDate'}, undef, $now, $users_to_mail{$_}->{'UserIndex'}); }; logw(1,sprintf("Failure to mark user %s as e-mailed, %s", $users_to_mail{$_}->{'UserID'}, $@)) if $@; } . . On being executed, I see an error as follows in the log. Failure to mark user MC001234 as e-mailed, Can't mix placeholder styles (3/1) at C:/Perl/lib/DBD/ODBC.pm line 134. This is puzzling as the DBI code uses only ? as the placeholders. :N or :Name are not used/mixed. I also do not understand the use of undef in the above. Please tell me how I can fix this error. Thanks
|