Returns True if the value of a given attribute or variable is empty 1.
Attribute | &Variable.IsEmpty()
Type Returned:
Boolean (True or False)
Using the method with attributes will depend on whether the condition is evaluated on the Server (DBMS) or the Client (Aplication Server). At the Cliente side, if an attribute is null (or empty), the IsEmpty method return true (in most situations, GeneXus handles nulls for attributes as expected). At the Server side, only if the attribute is empty (not null), the IsEmpty method returns true.
Trailing blanks are ignored.
In this case, the condition is evaluated by the server side, so only empty' values are retrieved.2
For each
Where attribute.IsEmpty() // server side execution
... // Only Empty attributes will be considered
EndFor
This code is evaluated at the client side. Both null and empty values are retrieved.
For Each
If attribute.IsEmpty() // client side execution
... // Empty and Null attributes will be considered
EndIf
EndFor
The following table shows the corresponding empty value for each data type and DBMS.
DBMS |
Numeric |
Date |
Datetime |
Character (n) |
Varchar |
Long Varchar |
Blob |
SQL Server |
0 |
1753-01-01 00:00:00.000 |
1753-01-01 00:00:00.000 |
n blanks |
<empty string> |
<empty string> |
<empty file> |
|
Oracle |
0 |
0001-01-01 00:00:00 |
0001-01-01 00:00:00 |
n blanks |
1 blank |
1 blank |
<empty file> |
|
DB2 UDB |
0 |
0001-01-01 |
0001-01-01 00:00:00.000 |
n blanks |
<empty string> |
<empty string> |
<empty file> |
|
DB2 iSeries |
0 |
"00000000" or 0001-01-01(*) |
0001-01-01-00.00.00 |
n blanks |
<empty string> |
<empty string> |
<empty file> |
|
MySQL |
0 |
1000-01-01 |
1000-01-01 00:00:00 |
<empty string> |
<empty string> |
<empty string> |
<empty file> |
|
PostgreSQL |
0 |
0001-01-01 |
0001-01-01 00:00:00 |
n blanks |
<empty string> |
<empty string> |
<empty file> |
|
Informix |
0 |
0001-01-01 |
0001-01-01 00:00:00 |
n blanks |
<empty string> |
<empty string> |
<empty file> |
2 Some "Where" conditions could be resolved on the client side. This could happen when the navigation group (For Each, Data Provider, Grid) includes in their Where/Condition clause a function or method that can not be evaluated by the DBMS. In this case, a warning icon will be shown for that condition in the navigation list. Passing the mouse over it displays: "Constraint evaluated in the client. This may lead to poor performance"
Objects: Procedures, Transactions, Web Panels
Languages: .NET, Java, Ruby (up to GeneXus X Evolution 3), RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol
Nullvalue Function
IsNull Function
Null Function
|