Solved

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

Posted on 2011-03-22
7
657 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 Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

632 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