Subject | Re: Inserting a character in place of another |
---|---|
Author | Ali Gökçen |
Post date | 2005-05-04T09:16:24Z |
Yes you can..
here is the my trick:
..
dec i integer;
dec tmp varchar(1024);
..
i=1;
while ( substring(victim from i for 1)<>'')
do
if(substring(victim from i for 1) = '?') then tmp= tmp || '!';
else tmp = tmp || substring(victim from i for 1);
i = i + 1;
end;
victim = tmp;
..
i wrote it immedietly..
you can also optimize this algorithm.
Regards,
Ali
here is the my trick:
..
dec i integer;
dec tmp varchar(1024);
..
i=1;
while ( substring(victim from i for 1)<>'')
do
if(substring(victim from i for 1) = '?') then tmp= tmp || '!';
else tmp = tmp || substring(victim from i for 1);
i = i + 1;
end;
victim = tmp;
..
i wrote it immedietly..
you can also optimize this algorithm.
Regards,
Ali
--- In firebird-support@yahoogroups.com, "rodbracher" <rod@m...> wrote:
> Hi
>
> Anyone know of a function that would replace one charater with
another
> if the given char exists (in an update statement)
>
> Basically I need to replace all spaces with ascii_char(xxx) for a
> given column.
>
> E.g. '8 100' should become '8♣100'
>
> Thanks
>
> Rod