
05-02-2008, 05:04 AM
|
| |
Re: Space between characters Thank you. Translate is working
Dave Hughes wrote:
>> I HAVE A STRING: ABCDEFG
>>
>[quoted text clipped - 4 lines]
>>
>> Thank's in advance Leny G.
>
>The TRANSLATE function [1] can be handy for this:
>
>VALUES TRANSLATE('A B C D E F G H', SOMESTRING, 'ABCDEFGH')
>
>For example:
>
>SELECT
> TRANSLATE('A B C D E F G H', S, 'ABCDEFGH')
>FROM (
> VALUES
> ('ABCD'),
> ('1234'),
> ('Testing')
> ) AS T(S)
>
>Outputs:
>
>1
>---------------
>A B C D
>1 2 3 4
>T e s t i n g
>
> 3 record(s) selected.
>
>Just expand the first and third parameters with more characters if
>extra length is required.
>
>[1]
>http://publib.boulder.ibm.com/infoce.../com.ibm.db2.l
>uw.sql.ref.doc/doc/r0000862.html
>
>Cheers,
>
>Dave.
--
Message posted via http://www.dbmonster.com |