Question
Problem Using SQL Like Condition On Column With Null Values
Hello,
I have written a query in Coldfusion that returns records from a table matching a parsed keyword. However, because the table column I am using contains some null values I am getting the following error.
***
Exceptions
15:39:26.026 - java.lang.NullPointerException - in C:\ColdFusion8\wwwroot\Websites\morepeoplemoreactive.com\components\clubs\clubs.cfc : line 132
15:39:26.026 - java.lang.NullPointerException - in C:\ColdFusion8\wwwroot\Websites\morepeoplemoreactive.com\components\clubs\clubs.cfc : line 132
15:39:26.026 - java.lang.NullPointerException - in C:\ColdFusion8\wwwroot\Websites\morepeoplemoreactive.com\components\clubs\clubs.cfc : line 132
***
Here is my SQL statement:
***
lower(address) like '%#lcase(arguments.keyword)#%'
***
Is there an easy way of overcoming this problem?
Thank you in advance for your help.
I have written a query in Coldfusion that returns records from a table matching a parsed keyword. However, because the table column I am using contains some null values I am getting the following error.
***
Exceptions
15:39:26.026 - java.lang.NullPointerException - in C:\ColdFusion8\wwwroot\Websites\morepeoplemoreactive.com\components\clubs\clubs.cfc : line 132
15:39:26.026 - java.lang.NullPointerException - in C:\ColdFusion8\wwwroot\Websites\morepeoplemoreactive.com\components\clubs\clubs.cfc : line 132
15:39:26.026 - java.lang.NullPointerException - in C:\ColdFusion8\wwwroot\Websites\morepeoplemoreactive.com\components\clubs\clubs.cfc : line 132
***
Here is my SQL statement:
***
lower(address) like '%#lcase(arguments.keyword)#%'
***
Is there an easy way of overcoming this problem?
Thank you in advance for your help.
