Re: [SQL] regexp_replace usage

2006-10-02 Thread chester c young
Thanks !Michael Fuhr <[EMAIL PROTECTED]> wrote:Offhand I can't think of a way to do what you want with regexp_replace()but you could use PL/Perl. Something like this should work:CREATE FUNCTION mcfix(text) RETURNS text AS $$ $_[0] =~ s/\bMc([a-z])/Mc\u$1/g; return $_[0];$$ LANGUAGE plperl IMMUTA

Re: [SQL] regexp_replace usage

2006-10-01 Thread Michael Fuhr
On Fri, Sep 29, 2006 at 02:31:12PM -0700, chester c young wrote: > column name in table bue has miscapitalized Mc names, eg, 'John Mcneil' > instead of 'John McNeil'. > > (this should be easy but) how do you construct the update query? > > also, regexp_string( 'Mcneil', 'Mc(.*)', initcap('\\1') )

[SQL] regexp_replace usage

2006-09-29 Thread chester c young
column name in table bue has miscapitalized Mc names, eg, 'John Mcneil' instead of 'John McNeil'.(this should be easy but) how do you construct the update query?also, regexp_string( 'Mcneil', 'Mc(.*)', initcap('\\1') ) => 'neil' _not_ Neil' - is this correct? All-new Yahoo! Mail - Fire up a mor