ccchg.txt TOADDE|EQANNB| TOADDF|EQANNB| CAABBB|FUAAAF| OFAAAA|OFAA| OFAAAB|OFAA| OFAAAC|OFAA| OFAAAD|OFAA| #### open (CC,"ccchg.txt"); while ($_=) { push (@CC,$_); ($old,$new)=split(/\|/,$_); push @old,$old; push @new,$new; } close (CC); $i=@old ## get number of codes ### Attributes to pass to DBI->connect() to disable automatic ### error checking my %attr = ( PrintError => 0, RaiseError => 0, ); ### Perform the connection using the Informix driver my $dbh = DBI->connect( "dbi:Informix:nps\@sumitt_dev", "user","password",\%attr ) or die "Can't connect to database: ", $DBI::errstr, "\n"; $sth=$dbh->prepare("SELECT req_id, ccode FROM rtsdet a WHERE req_id IN ('48111','15313','45813','15226','48426','72703') "); $sth->execute(); while ( ($po, $ccode) = $sth->fetchrow_array() ){ push (@po,$po); } $sth->finish; $sth=$dbh->prepare("UPDATE rtsdet SET ccode=? WHERE req_id=? AND ccode=?"); foreach $po(@po) { for ($count=0; $count<$i;$count++) { $sth->execute($new[$count],$po,$old[$count]); } } $sth->finish; OFAA\ | OFAA\ | OFAA\ | OFAA\ | OFAA\ |