NULL_VALUE Function
Syntax
Returns
- resultAny Type
Returns a null value. Not supported for numeric Xbasic variables.
Description
Assign a null value to any data type.
Discussion
NULL_VALUE() is used in an Update Operation or an Xbasic script to assign null to a DBF field or Xbasic variable.
For example, to assign a NULL value to a DBF Field:
dim t as P
t = table.open("orders")
t.change_begin()
t.date = NULL_VALUE()
t.change_end(.T.)
t.close()NULL_VALUE() cannot be used to set a null value in a SQL::Arguments object. Use SQL::Arguments setNull().
Numeric variables are a special case. You cannot use NULL_VALUE() with a numeric variable. However, if you have a numeric field in a DBF table, you can set the field value to NULL_VALUE().
dim t as P
t = table.open("journal")
? t.PERIOD_YEAR
= 34
t.change_begin()
t.PERIOD_YEAR = NULL_VALUE()
t.change_end(.t.)
t.close()
? t.PERIOD_YEAR
= 0While the numeric field, t.PERIOD_YEAR, reported 0 as it's value in the example above, if you look at the table in browse mode where NULL_VALUE() was assigned to a numeric field, no value will be visible in the field.
Xbasic Variable Null Values
When assigned to an Xbasic variable, NULL_VALUE() returns the following:
dim vA as a = null_value()
? vA
= <Has no sub-properties>
dim vB as b = null_value()
? vB
=
dim vC as c = null_value()
? vC
= ""
dim vD as d = null_value()
? vD
= { / / }
dim vF as f = null_value()
? vF
= <No data returned>
dim vL as l = null_value()
? vL
= .F.
dim vN as n = null_value()
? vN
= 0
dim vP as p = null_value()
? vP
= <Has no sub-properties>
dim vT as t = null_value()
? vT
=
dim vU as u = null_value()
? vU
= <Has no sub-properties>See Also