Solved

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

Posted on 2011-03-22
7
653 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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Web Service from a stored procdure oracle 10 55
database upgrade 8 74
Oracle - SQL Parse String 5 34
ODBC in excel 2016 in Windows 10 via VBA 16 74
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to take different types of Oracle backups using RMAN.

770 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