Unable to trim blank space in below data in my table. column data type is VARCHAR2(650 CHAR). I tried trim function to eliminate blank space. but that is not working for me.
DATA in my table:
'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14 '
'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14 '
'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14 '
I want trim the data like below
'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14'
'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14'
'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14'
Could you please help me on this.
We also can trim left and right side blank spaces using below approach
Use
Trim
Functionor Use
Rtrim
I would use
REGEXP_REPLACE()
in the event that there were other whitespace charaters like tabs in there:Hope this helps. If
TRIM()
isn't working then I suspect you have something other than spaces trailing.If you know that the data is going to end with a digit, you might also try the following:
The
\D
in the regex matches everything but a digit, so any trailing characters not a digit0-9
will be trimmed.