Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: whitespaces
Varchar2 will not leave any trailing blank spaces.
Only Char field does.
See this example
Create table temp
( Co1 Varchar2(5)
Col2 Char(5)
);
Insert into temp
Values('KING', 'KING');
Select col1, length(col1), col2, length(col2) from temp
COL1 LENGTH(COL1) COL2 LENGTH(COL2)
----- ------------ ----- ------------
KING 4 KING 5
Cheers
Fazal
--- Jon Baker <jcb_at_netsec.net> wrote:
> use the rtrim function.
>
> rtrim(char[,set]) - char, with final characters
> removed after the last
> character not in set. set defaults to ' '.
>
>
> i.e.:
>
> update <table> set <field>=rtrim(<field>);
>
>
>
> Jon Baker
> Database Architect
> <jcb_at_netsec.net>
> www.netsec.net
>
>
>
>
> -----Original Message-----
> Sent: Thursday, February 14, 2002 9:08 AM
> To: Multiple recipients of list ORACLE-L
>
>
> Hi,
>
> What query can i run to to eliminate trailing
> whitespaces. e.g. i have
> 'abc ' and want to update the table so any such
> data is set without the
> whitespace, in this case 'abc'
>
> the fiels is varchar2
> 8.1.7.
>
> cheers
>
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author:
> INET: iashraf_at_csc.com
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists
>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Abul Fazal INET: angmokios_at_yahoo.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Tue Feb 19 2002 - 01:03:17 CST