Database View Table Where Clause to contain NULL

mike_bush
Kilo Guru

I want to improve my DB View performance by including a null test in a where clause (rather than let hundreds more records through and have to include the condition in every report I write).

Syntax for where clause doesn't SEEM to support this - neither

        field != ''

nor

        field = NULL

seem to work?

Has anyone managed to get a null test into a View Table Where Clause?

1 ACCEPTED SOLUTION

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Mike,



If anyone has found a way to work a null test into a database view where clause, I do not see this   mentioned in the ServiceNow Community.


Adding a report on the db view has been mentioned as a workaround but you are already doing that.



The possibility of using a before query business rule is mentioned here:


http://www.snc-blog.com/2014/08/07/a-view-on-database-views/


I have not tried this, and it might or might not improve performance.



Best Regards



Tony


View solution in original post

7 REPLIES 7

joey_mart
ServiceNow Employee
ServiceNow Employee

I've created PRB1407205 in HI for this. We'll support the "ISNULL" operator starting in the Quebec release.

Maybe way too late to actually help anyone, but it'll be there.

joey_mart
ServiceNow Employee
ServiceNow Employee

You'll be able to do something like:

taskslatable_task = inc_sys_id && inc_assigned_to  ISNULL

@joey.mart is there also OOtB for ISNOTNULL?