Have you done a rollback of the affected database table
after the failed attempt(s)? If not, then of course the
same old input data file will now have no suitable records
to work on in the table, because those old "ccode" values are
not present anymore -- they've all been changed to something
else. Running the script again on the altered table will
produce no errors, and will also produce no further change
in the table, because the update statement has to match those
old "ccode" values given in "ccchgtab.txt" and these are no
longer in the table.
If you cannot rollback the table to get those old values
again, then you must get a fresh dump of the affected records
to create a new input file, and/or figure out how to do the
updates without doing an exact match on the existing values
of "ccode" -- something like:
update rtsdet set ccode='OFAA' where ccode like 'OFAA%' and
...
(if Informix supports the "%" expression in SQL string matches
the way Oracle does, then you can include "%" as part of the
"old" string pattern in your data file, and it will work as
intended)
As for why the funny content got into the table in the first
place, I don't see how that would result from either version
of your code -- unless there was some subtlety that got
munged or left out when you tried to post it.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.