Home » SQL & PL/SQL » SQL & PL/SQL » INFO REQ on string manipulation (win xp)
INFO REQ on string manipulation [message #308980] Wed, 26 March 2008 02:25 Go to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
is there any function in any versions of oracle that wll remove the in between spaces from a string value???

other than replace and translate

for example:: s...was..t..i.....k

Thanks
Re: INFO REQ on string manipulation [message #308982 is a reply to message #308980] Wed, 26 March 2008 02:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Is there any way to walk other than using feet, knees, hands or crutches?

Yes, there is. Find it, it is a good exercise.

Regards
Michel
Re: INFO REQ on string manipulation [message #308984 is a reply to message #308982] Wed, 26 March 2008 02:54 Go to previous messageGo to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
Don' know whether you felt that it's not a genuine question hence such a reply
Re: INFO REQ on string manipulation [message #308985 is a reply to message #308984] Wed, 26 March 2008 02:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There are tools/functions to do it, you don't want to use them, why should I not feel it's not a genuine question?
Explan why you don't want to use the appropriate functions!

Regards
Michel
Re: INFO REQ on string manipulation [message #309067 is a reply to message #308980] Wed, 26 March 2008 06:29 Go to previous messageGo to next message
cherry
Messages: 56
Registered: December 2007
Member
Trim
Re: INFO REQ on string manipulation [message #309073 is a reply to message #309067] Wed, 26 March 2008 06:36 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Trim does not remove blanks inside strings (if this is the question).

Regards
Michel
Re: INFO REQ on string manipulation [message #309093 is a reply to message #308980] Wed, 26 March 2008 07:21 Go to previous messageGo to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
Michel answering your qn why i asked like this we all know how ltrim,rtrim,trim works in removing spaces,bu the thing is these functions gets the string values directly as argument and does their work

where as the replace and translate ones makes use of source and destination strings like they need some inputs what what to replace and translate,

i thought that if we can have some function that can do this job of removing inbetween spaces directly as other trim functions then its better.

if this qn is not genuine then i will take care further.

thanks
Re: INFO REQ on string manipulation [message #309097 is a reply to message #309093] Wed, 26 March 2008 07:27 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
What is the difference (as you described with "get the string directly") between

string_a := trim(string_a);
and
string_a := replace(string_a, ' ');

???

Why bother to find a hard way of doing things when you already know the easy way?
If this is meant as a mind-exercise, you better say so in your question; otherwise people here think you're talking production-code
Re: INFO REQ on string manipulation [message #309106 is a reply to message #308980] Wed, 26 March 2008 07:43 Go to previous messageGo to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
in that sence i think i should have mentioned that
yes this is a mind excersise and not a production code,unfortunately there is no specific section to post general queries and production codes.

but i was thinking of may be some thing like this

select alltrim('s...wa..s.ti...k') from dual;

ans:
swastik
Re: INFO REQ on string manipulation [message #309120 is a reply to message #309106] Wed, 26 March 2008 08:31 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Write your own.
You can also do it in SQL.
As it is a mind exercise, do it, it will exercise your mind.

Regards
Michel
Previous Topic: Join Query
Next Topic: Sum recursively values inside same column
Goto Forum:
  


Current Time: Thu Dec 08 00:23:04 CST 2016

Total time taken to generate the page: 0.21850 seconds