A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Databases
»
JDBC
Author
SQL Trim Function
Abu Nene
Ranch Hand
Joined: Nov 13, 2008
Posts: 56
posted
May 18, 2009 00:57:56
0
Hi it is a good practise to apply the SQL trim function on all the VARCHAR2 column used in the where clause? For eg.
select * from table A where trim(B) = 'test'
Please advise, thanks.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
May 18, 2009 01:32:37
0
That depends on whether any whitespace might be significant for the application's purposes or not.
Android apps
–
ImageJ plugins
–
Java web charts
Jan Cumps
Bartender
Joined: Dec 20, 2006
Posts: 2343
I like...
posted
May 18, 2009 03:55:10
0
On several databases, this has a performance impact if the field is indexed. Yorur database might stop using the index if you wrap a function around your field.
OCUP UML fundamental
ITIL foundation
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: SQL Trim Function
Similar Threads
using Strings to query database??
q from abhilash mock exam on strings.
Using Trim function in Hibernate
Is there any trim function in xsl ?
Login JSP page using mysql(DB)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter