Meaningless Drivel is fun!
The moose likes JDBC and Relational Databases and the fly likes SQL Trim Function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "SQL Trim Function" Watch "SQL Trim Function" New topic

SQL Trim Function

Abu Nene
Ranch Hand

Joined: Nov 13, 2008
Posts: 56
Hi it is a good practise to apply the SQL trim function on all the VARCHAR2 column used in the where clause? For eg.

Please advise, thanks.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
That depends on whether any whitespace might be significant for the application's purposes or not.
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

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 and ITIL foundation
I agree. Here's the link:
subject: SQL Trim Function
It's not a secret anymore!