IsNull Function

Official Content
This documentation is valid for:
Allows you to determine if an attribute's value is DBMS NULL.  

Syntax

IsNull(Attribute)

Type Returned: Boolean Value 

Where:
Attribute
Is the attribute that will be evaluated.

Description

In some cases it is necessary to determine if an attribute's value matches the DBMS NULL. This value is different from the nullvalue (obtained, for example, using the Nullvalue (Attribute) function), determined by GeneXus according to the data/DBMS type. 

The NULL value of an attribute could have been generated, for example, if the attribute has not been instanced in a New command (with the “Initialize not referenced attributes” preference set to “No”). It may also be necessary to distinguish it from other values when external tables are accessed. 
When the function is used by including it in Where or Condition commands that are optimized (which means the condition is solved in the server), it will be translated as...Attribute IS NULL in the SQL statement.

Notes:

  • This function can only be used within For Each and Condition commands of Grids that have a base table. 
  • For local DBMSs (Access and DBFs) the IsNull() function behaves in the same way as the Null() function.

Examples

Example 1
 

For each
    Where IsNull(CliNom)
       ...   ...
       ...   ...
EndFor

This 'For each' command navigates through all the Client records that have the CliNom attribute with a DBMS NULL value. 

Example 2
 

For each
    If IsNull(CliNom)
       ...
    EndIf
    ...
    ...
EndFor

This example is similar to the first one, as it navigates through the same records. The difference is that, in the first case, the condition is solved in the server and, in the second example, it is solved in the client.

Scope

Objects: Procedures, Transactions, Web Panels
Languages: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

See Also

Null Function
Nullvalue Function








Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.