Subject | Re: Replace character in Firebird |
---|---|
Author | nikoskapa |
Post date | 2007-05-24T14:23:18Z |
--- In firebird-support@yahoogroups.com, "Milan Babuskov" <milanb@...>
wrote:
How to install it in firebird dbms?
wrote:
>I wish to use the rFunc library.
> --- nikoskapa wrote:
> > How to replace a specific character e.g. 'a' with another character in
> > a firebird fieldtable using an update sql script?
>
> Well, perhaps something like this:
>
> /* replace A with B */
> update table1
> set field1 = substrlen(field1, 1, strpos(field1, 'A') - 1) || 'B' ||
> substr(field1, strpos(field1, 'A')+1, strlen(field1))
> where field1 containing 'A';
>
> Repeat that while you have A's. Now, that's the most inefficient way.
> You can also do it in a stored procedure or execute block, or you can
> use STR_REPLACE udf from rFunc library:
>
> http://rfunc.sourceforge.net/
>
> like this:
>
> update table1 set field1 = str_replace(field1, 'A', 'B');
>
>
> --
> Milan Babuskov
> http://www.guacosoft.com
> http://www.flamerobin.org
>
How to install it in firebird dbms?