This content has been marked as final. Show 8 replies
Any reason why you don't want to use trim, ltrim or rtrim when they do the job?
select nvl2( replace( empdepartment, ' ' ), 'b', 'a' ) from abc
no reason at all, just wanted to know any thing better exist , but i think trim are better than nlv2 ? please correct me.
nvl2 is an alternative for the case statement
replace is an alternative for trim
1 person found this helpful
944768 wrote:So, you're requirement is that you want to trim spaces, and you want to know if there's anything better than "trim" to do it?
no reason at all, just wanted to know any thing better exist
What an odd request.
That's like saying you want to add two numbers together, and is there any better way than using "+" to do it?
And how do you define better in this case?
Faster? I suppose ltrim and rtrim are faster than trim but that you will not notice the diference with 100000 records. Same for others methods
Easier to understand? It depends on what you are used too. Looking at the way you ruled out nvl2 you will not find anything "better".
Some other metrics????
it sounds like that, but my primary task was to fillter spaces getting into my case or if statment.
to accomplish that i have to trim it becasue triming makes it empty and empty is treated as null, so now i chould fillter them using "is null".
so i was searching for any specific function made for them , but if trim is making spaces empty and out come can be compaired with "is null" to yield true.
then will use it throught out all stored proces in database.
Edited by: 944768 on Mar 5, 2013 3:00 AM
Edited by: 944768 on Mar 12, 2013 1:02 AM