my $dbh = DBI->connect("dbi:Informix:$db\@$server", "$user", "$pw"); $dbh->{ix_WithoutReplication} = 1; $dbh->{AutoCommit} = 0; $sth = $dbh->prepare('BEGIN WORK') or die $DBI::errstr."\n"; $sth->execute(); undef $sth; open(loadfile,") { chomp(); @all_cols = split(/\\|/,$line); if (! defined $sth) # is executed only one time { $sth = $dbh->prepare_cached("INSERT INTO mytable VALUES(?,?,?,?,?)") or die "Error: ".$DBI::errstr."\n"; } $sth->execute(@all_cols) or die "Error: \"".$DBI::errstr."\"\n"; $x++; } $sth = $dbh->prepare('COMMIT WORK') or die "Error: ".$DBI::errstr."\n"; $sth->execute();