version 1.5
OD SET NULL VALUE (type; value)
| Parameter | Type | Description | |
| type | Integer | Variable type | |
| value | Alpha | NULL equivalent for type converted into Alpha |
Description
The OD SET NULL VALUE command allows you to specify for each 4th Dimension data type the constant that represents Oracle's NULL value. If the constant is entered in a 4th Dimension field or variable, the corresponding Oracle row is updated with the NULL value. If an Oracle row contains the NULL value, the corresponding 4th Dimension field or variable displays the constant.
type is an integer that specifies the type of 4th Dimension field or variable for which you are setting the NULL value equivalent. The following table lists the types of fields and variables and their numeric codes:
| Field or variable type | Code |
| Alpha | 0 |
| Real | 1 |
| Text | 2 |
| Date | 4 |
| Boolean | 6 |
| Integer | 8 |
| Longint | 9 |
| Time | 11 |
value is the NULL value equivalent for type. value can be any string constant. The following table shows the default NULL value equivalents for each type:
| Field or variable type | Default null value |
| Alpha | "" |
| Real | "0" |
| Text | "" |
| Date | "00/00/00" |
| Boolean | "0" (i.e. False) |
| Integer | "0" |
| Longint | "0" |
| Time | "00:00:00" |
Examples
(1) The default NULL value equivalent for a Real field or variable is "0". You could change the NULL value equivalent to "-1" by executing the following statement:
OD SET NULL VALUE (1; "-1")
If an Oracle NULL value needs to be loaded into a 4th Dimension Real field or variable, it will receive -1 as its value. If a 4th Dimension Real field or variable containing -1 is encountered, the NULL value will be sent to Oracle.
In 4th Dimension, the time and date are stored in fields or variables of two distinct types, Time and Date. In Oracle, the time and date are combined into one data type: Date.
After the execution of:
OD SET NULL VALUE (4; "01/01/01") OD SET NULL VALUE (11;"02:02:02")
you will see the following behavior:
SQL to 4th Dimension:
| SQL | 4th Dimension |
| Date = "13-NOV-85 10:56 A.M." | Date := 13/11/85 |
| Time:= 10:56:00 | Date = NULL |
| Date:= 01/01/01 | Time:= 02:02:02 |
4th Dimension to SQL:
| 4th Dimension | SQL |
| Date:= 01/01/01 | Time:= 02:02:02 |
| Date= NULL | Date:= 13/11/85 |
| Time:= 10:56:00 | Date= "13-NOV-85 10:56 A.M." |
| Date:= 13/11/85 | Time:= 02:02:02 |
| Date= "13-NOV-85" | Date:= 01/01/01 |
| Time:= 10:56:00 | Date= "10:56 A.M." |