• 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: 42968
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: 2602
13
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic