Solved

How to trim in between blank spaces of a character string in Oracle

Posted on 2011-03-22
7
651 Views
Last Modified: 2013-12-19
Hi All,
I would like your idea and input on how to trim the blank spaces in between a character string in Oracle. For example I have this character strings as 'I go to sleep' how can I make it to become 'Igotosleep'. I try the trim function but it does not work.
0
Comment
Question by:lmymusic2000
7 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 35194148
Simple replace?  Replace(column,' ','')
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 35194154
replace(yourstring,' ')
0
 

Expert Comment

by:jm76430
ID: 35194179
try this: select replace('THIS IS a test.', ' ', NULL) from dual;
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Expert Comment

by:ponnuswamys
ID: 35194650
SELECT REPLACE("Your String", CHR(32), '') FROM DUAL will replace any blank spaces in the given string
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35194665
Why make an additional function call when it is not needed?
0
 

Author Closing Comment

by:lmymusic2000
ID: 35198449
You nail it, slightwv. Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now