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
Title: RE: whitespaces
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
[EMAIL PROTECTED]
www.netsec.net
Try
update table_name
set field_name = rtrim(field_name);
I think the Right Trim should clear off the trailing spaces.
-Original Message-
Sent: Thursday, February 14, 2002 8:08 AM
To: Multiple recipients of list ORACLE-L
Hi,
What query can i run to to eliminate trailing
update mytable
set myfield = rtrim(myfield)
;
That's the simple answer. If most of your fields do not have trailing
spaces, then:
update mytable
set myfield = rtrim(myfield)
where myfield like '% '
;
If your table is large, you'll need to watch out for rollback issues, etc.
I'm sure there are