ukndoit has asked for the wisdom of the Perl Monks concerning the following question:
But I don't know how to just select from mysql those in rec that have any capital letters, can you help me?my $sth = $dbh->prepare(qq{SELECT `id`,`rec` FROM `memrecs`}); $sth->execute(); while(my ($_id,$_rec) = $sth->selectrow_array()) { if($_rec =~ /A .. Z/) { $_rec =~ tr/A-Z/a-z/g; $dbh->do(qq{UPDATE `memrecs` SET `rec` = ? WHERE `id` = ?}, undef, +"$_rec", "$_id"); } } $sth->finish();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Checking MySql for capital letters
by erroneousBollock (Curate) on Sep 25, 2007 at 05:38 UTC | |
|
Re: Checking MySql for capital letters
by graff (Chancellor) on Sep 25, 2007 at 11:52 UTC | |
|
Re: Checking MySql for capital letters
by andreas1234567 (Vicar) on Sep 25, 2007 at 08:12 UTC |