• Post Reply Bookmark Topic Watch Topic
  • New Topic

SQL Trim Function

 
Abu Nene
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on whether any whitespace might be significant for the application's purposes or not.
 
Jan Cumps
Bartender
Posts: 2619
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!