vivekvp has asked for the wisdom of the Perl Monks concerning the following question:
Here is the code:ccchg.txt TOADDE|EQANNB| TOADDF|EQANNB| CAABBB|FUAAAF| OFAAAA|OFAA| OFAAAB|OFAA| OFAAAC|OFAA| OFAAAD|OFAA|
Notice the \ and |. Any idea what is causing these?open (CC,"ccchg.txt"); while ($_=<CC>) { 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','7270 +3') "); $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; <code> OFAA\ | OFAA\ | OFAA\ | OFAA\ | OFAA\ |
2002-03-26 Edit by Corion: Fixed long wrapping line, replaced login information
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: VVP:DBI and weird chars
by Zaxo (Archbishop) on Mar 26, 2002 at 20:18 UTC | |
by vivekvp (Acolyte) on Mar 26, 2002 at 20:43 UTC | |
by vivekvp (Acolyte) on Mar 26, 2002 at 23:06 UTC | |
by graff (Chancellor) on Mar 27, 2002 at 06:42 UTC | |
by vivekvp (Acolyte) on Mar 28, 2002 at 19:50 UTC | |
by rdfield (Priest) on Mar 27, 2002 at 10:27 UTC | |
by vivekvp (Acolyte) on Mar 28, 2002 at 12:50 UTC |