skip to main content
OpenEdge Data Management: DataServer for ODBC
Programming Considerations : Database design issues : Unknown values
 

Unknown values

The DataServer supports ODBC data-source null values. Procedures that use a null value behave exactly as they do when accessing an unknown value ("?") in an OpenEdge database, except for one difference—you cannot compare a field to the unknown value if the field is not allowed to hold the unknown value (i.e., is not null-capable). For example, if the custnum field is not allowed to hold the unknown value, the following statement fails at run time:
FIND customer WHERE customer.custnum <> ?
See the documentation for your data source to determine whether it supports null values.
A column that is not allowed to hold the unknown value is marked "mandatory" in the schema holder.In a DataServer application, you assign the unknown value to a column in an ODBC data source by using the question mark operator (?), which the DataServer translates to the appropriate null-value representation for the data source. For example, the following procedure assigns the unknown value to the address2 field of the customer table:
FIND FIRST customer NO-ERROR.
IF AVAILABLE customer THEN
  customer.address2 = ?.