Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2011-03-22
7
654 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 74

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to take different types of Oracle backups using RMAN.

765 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