tuple_status - all errors are the same but shouldn't be
- From: "Adrian" <adrian.waters@xxxxxxxxxxxx>
- Date: 24 May 2005 02:35:05 -0700
I use execute_array to do a number of updates to a database. Some of
the updates fail. If I switch on tracing with
DBI->trace( 4, "/tmp/dbitrace" );
I can see each of the failures produces a different error message.
However, when I use the status text from tuple_status, every message is
the the same.
Here is my code:
$sth = $dbh->prepare("CALL uspDocumentAdd ('C', ?, ?, ?, ?, ?)");
my $iTuplesExecuted = $sth->execute_array(
{ ArrayTupleStatus => \my @tuple_status },
\@cust_number,
\@doc_category,
\@dtissue,
\@asFilename,
\@aiRecordCount
);
if( $iTuplesExecuted )
{
print $LOGFILE "All ok.\n";
}
else # iTuplesExecuted is undef, i.e. an error occurred
{
for my $iTuple ( 0..@cust_number - 1 )
{
my $status = $tuple_status[$iTuple];
$status = [0, "Skipped"] unless defined $status;
next unless ref $status;
printf $LOGFILE "ERROR: Failed to insert: Customer number %s.
Received status %s\n", $cust_number[$iTuple], $status->[1];
}
}
I have examined @tuple_status every which way and I am sure every error
message is the same - the first is repeated over and over when each
should be different. Has anyone encountered this? Any assistance would
be much appreciated.
Adrian.
.
- Prev by Date: Re: DBI->disconnect is not a DBI method. Read the DBI manual. at ff.pl line 224
- Next by Date: Re: /usr/bin/ls: 0403-027 The parameter list is too long
- Previous by thread: locale problem with DBD::DB2
- Next by thread: Reg. perl module installation
- Index(es):