EMPTY()

Advantage Concepts

Advantage Expression Engine function that determines if the result of an expression is empty for DBFs or NULL for ADTs

Syntax

EMPTY(<exp>) à lEmpty

Parameters

<exp>  An expression of any data type.

Return Values

When using DBF tables, EMPTY() returns True if the expression results in an empty value; otherwise, it returns False. When using ADT tables, EMPTY() returns True if the expression results in a NULL value; otherwise, it returns False.

The criteria for determining whether a value is considered NULL when using ADT tables depends on the data type of <exp>. Advantage internally stores a special data type dependent value that indicates to the Advantage application the value is NULL. Any time a record is inserted, appended, or cleared, all column values will be set to their NULL value.

The criteria for determining whether a value is considered empty when using DBF tables depends on the data type of <exp> according to the following rules:

List of DBF Empty Values:

DBF Data Type

Contents

Character

Spaces, tabs, CR/LF, or an empty string ("")

Numeric, Integer, Double

0

Date, ShortDate

CTOD("") or STOD("")

Logical

False (.F.)

Remarks

When using DBF tables, the EMPTY() function treats carriage returns, line feeds, and tabs as space characters and removes these as well. When <exp> is a DBF memo field, the EMPTY function returns True if the memo field does not contain any data.

Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.

Note Memo, binary, and image fields are not supported in this Advantage Expression Engine function. If memo, binary, or image fields are used with this expression engine function, the Advantage Expression Engine will be unable to evaluate the expression.

See Also

LEN()