Solved

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

Posted on 2011-03-22
7
656 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
[X]
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
7 Comments
 
LVL 77

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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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 77

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

751 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