KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Avoid placeholder syntax when searching for null values by ORDA query
PRODUCT: 4D | VERSION: 17 | PLATFORM: Mac & Win
Published On: October 31, 2018
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

When trying to search through a database using ORDA's datastore or entity selection query, make sure to avoid using placeholder syntax when comparing a table field's value to null. The placeholder syntax in the query engine considers null as an unexpected comparison value. An example of what to avoid is given below:

C_OBJECT($peopleSelection)
$peopleSelection:=ds.People.query("spouse = :1";Null) // will NOT work and returns empty entity selection


Instead, make sure to be explicit and include the whole null comparison query within the double quotes.

C_OBJECT($peopleSelection)
$peopleSelection:=ds.People.query("spouse = null") // correct way to check field for null