Hello,
I am trying to execute an update to an Access database. The statement
has two placeholders, and I put two variables between the parentheses in
the execute statement, and yet Access tells me it expects 3 parameters.
This is the prepare:
my $sth_del = $dbh->prepare(
"UPDATE [DBI_TEST]
SET retired_date = ?
WHERE person_id = ?") or die "Cant prepare retired date: " .
$dbh->errstr;
This is the execute:
foreach my $del_rec (@del_recs) {
$sth_del->execute( $ret_date, $del_rec ) or die "Cant insert retired
date: " . $dbh->errstr;
}
I really don't understand why it wants three parameters. What exactly
does this mean?
Thanks,
Alan
The result I get from a level two trace is:
DBI::db=HASH(0x2278c2c) trace level set to 2 in DBI 1.14-nothread
-> prepare for DBD::ODBC::db (DBI::db=HASH(0x2278c68)~0x2278c2c
'UPDATE [DBI
_TEST]
SET retired_date = ?
WHERE person_id = ?')
dbd_preparse scanned 2 distinct placeholders
dbd_st_prepare'd sql f37040784
UPDATE [DBI_TEST]
SET retired_date = ?
WHERE person_id = ?
<- prepare= DBI::st=HASH(0x2278ff8) at jcdb_update.pl line 254.
-> execute for DBD::ODBC::st (DBI::st=HASH(0x2278ff8)~0x2278f74
'#11/1/2001#
' 22218)
bind 1 <== '#11/1/2001#' (attribs: )
bind 1 <== '#11/1/2001#' (size 11/12/0, ptype 4, otype 1)
bind 1: CTy=1, STy=VARCHAR, CD=80, Sc=0, VM=11.
bind 2 <== '22218' (attribs: )
bind 2 <== 22218 (size 5/6/0, ptype 6, otype 1)
bind 2: CTy=1, STy=VARCHAR, CD=80, Sc=0, VM=5.
dbd_st_execute (for sql f37040784 after)...
st_execute/SQLExecute error -1 recorded: [Microsoft][ODBC Microsoft
Access Drive
r] Too few parameters. Expected 3. (SQL-07001)(DBD:
st_execute/SQLExecute err=-1
)