Chas Owens wrote:
On 6/20/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
This might not be necessary for the RDMS you use, but I generally end
my database-driven scripts with this block:

END {
   if ($?) {
        print "Exiting with error, rolling back data!\n";
        $dbh->rollback();
   } else {
        print "Exiting successfully, committing data\n";
        $dbh->commit();
   }
   $dbh->disconnect();
}
snip

The rollback and commit methods will only have an effect if you have
set AutoCommit => 0 in the hash you call the connect method with.
Otherwise you will get a "commit ineffective with AutoCommit" or
"rollback ineffective with AutoCommit" warning.

thank you all,

However, it was not updated bcos the acctuniqueid value was getting a leading space which after i changed my code to read

$x[6]=~s/\s//gm;

the space was subtituted and all contents where updated.

Thank you.

Goksie

open FH, '<', $fn or die "The File $fn Could not be opened: $! \n";
while(<FH>)
{
#split the file into variables
  @x[0,1,2,3,4,5,6]=split/,/;
$x[6]=~s/\s//gm;
$sth->execute($x[2], $x[5], $x[4], $x[6]) or die "Error executing <<$sth->{Statement}>> with values @x[2,5,4,6]: $DBI::errstr";
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to