how to delete extra empty spaces

hi ow can i get value in column which got extra empty spaces and delete those extra spaces

value object  
must be
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Do you mean ?

TRIM('   word   ')

Hi you can use

TRIM( [ [ LEADING | TRAILING | BOTH ] trim_character FROM ] string1 )

TRIM('   tech   ')
Result: 'tech'

TRIM(' '  FROM  '   tech   ')
Result: 'tech'

TRIM(LEADING '0' FROM '000123')
Result: '123'

Result: 'Tech'

TRIM(BOTH '1' FROM '123Tech111')
Result: '23Tech'
chalie001Author Commented:
i have a word like this
Object > Object > Basic Item Information > Creation

and sql is

select * from temp_unt
where  learning_unit_name = TRIM(TRAILING ' ' FROM learning_unit_name)

i what empty spaces at the end and/or back of the word not in middle
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

slightwv (䄆 Netminder) Commented:
If TRIM isn't working for you, please post sample data and expected results.

Post the data in a 'code' block to preserve the spaces.

Click 'Code' in the menu directly above the box where you type your posts and enter the data inside the tags or select/highlight the text and click 'Code'.

This is a code block

Open in new window

chalie001Author Commented:
ok i what

'Object > Object > Basic Item Information > Creation '
' Object > Object > Basic Item Information > Creation'

to be like this 
'Object > Object > Basic Item Information > Creation'

Open in new window

Helena Markováprogrammer-analystCommented:
Here is another option:
select LTRIM(RTRIM(' Object > Object > Basic Item Information > Creation')) col1 from dual;
chalie001Author Commented:
if i what to remove those extra empty spaces from all values which got extra empty spaces how can i do that i do this

somethint like this

update cal_obj

set obj_name = trim(obj_name)



'Object > Object > Basic Item Information > Creation '

'Object > Object > Basic Item Information > test '

' Object > Object > Basic Item Information > new'

i what values to be like this after update


'Object > Object > Basic Item Information > Creation'

'Object > Object > Basic Item Information > test'

'Object > Object > Basic Item Information > new'
slightwv (䄆 Netminder) Commented:
>>somethint like this

The trim you posted will do exactly that.  What else is needed?

update some_table set some_column=trim(some_column);
chalie001Author Commented:
i have run the following query
update cal_book
set description = rtrim(description,' ')
          where obj_name = 'LLCOSD03.form'
          and learning_unit_number = '2';
          but after i comit am still geting an extry emty space in front of the value
          select * from cal_book
          where obj_name = 'LLCOSD03.form'
           and learning_unit_number = '2';

Open in new window


' test value'

to be this after update
'test value'
slightwv (䄆 Netminder) Commented:
RTRIM trims 'R'ight.

Just use regular TRIM like I posted.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.