Re: [ILUG] wee coding challenge..

From: kevin lyda (kevin at domain suberic.net)
Date: Thu 04 May 2000 - 15:35:09 IST


peter.mcevoy at domain iona.com wrote:
> update mytable
> set fullname = replace(fullname, ':');

right, it does support that. perhaps this would work:

use DBI;

$dbh=DBI::connect("dbi:driver:db", "user", "pass");
foreach $c (split(//, ":,%other bad chars")) {
        $dbh->do("update mytable set fullname = replace(fullname, "
                 . $dbh->quote($c) . ") where fullname like "
                 . $dbh->quote("%$c%");
}

more work for the db, but no need to shoot the data back and forth.

kevin

-- 
kevin at domain suberic.net       "we were goin' for breakfast.  in canada.  we
fork()'ed on 37058400    made a deal: if she'd stop hookin', i'd stop
meatspace place: work    shootin' people.  maybe we were aiming high."
                                                   --porter, "payback"


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:06:01 GMT