i do not want use ltrim or rtrim, becasue trim is also doing that job.
if i have ' ' or null it shows 'a' else it show 'b' the type of empdepartemtn is any type which can hold charecter .
select Case when trim(empdepartment) is null then 'a' else 'b' end from abc
1) Is there any other way to get the above result?
2) if the above col is lob then please send me solution sepratlly for lob.
no reason at all, just wanted to know any thing better exist
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?
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