Here's what I came up with in case anyone else needs a quick fix.  A
regular expression replace would've been nicer, but, you do what you
gotta do...

CREATE PROCEDURE `test`(`par` varchar(60))
BEGIN
        DECLARE nChars INT DEFAULT CHAR_LENGTH(par);
        DECLARE nCounter INT DEFAULT 1;
        DECLARE sPattern VARCHAR(300) DEFAULT '';
        DECLARE sRegEx VARCHAR(60) DEFAULT '[^a-zA-Z0-9]*';
        
        -- pad the regex pattern on each side of every character in the search 
string
        WHILE nCounter <= nChars DO
                SET sPattern = CONCAT(sPattern, sRegEx, SUBSTR(par, nCounter, 
1));
                SET nCounter = nCounter + 1;
        END WHILE;
        -- add the pattern to the end of the string too
        SET sPattern = CONCAT(sPattern, sRegEx);
        
END|

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to