OD SET NULL VALUE

4D - Documentation   Français   English   German   English   4D for Oracle, Command Theme List   4D for Oracle, Command Alphabetical List   Back   Previous   Next

version 1.5


OD SET NULL VALUE (type; value)

ParameterTypeDescription
typeIntegerVariable type
valueAlphaNULL 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 typeCode
Alpha0
Real1
Text2
Date4
Boolean6
Integer8
Longint9
Time11

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 typeDefault 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:00Date = NULL
Date:= 01/01/01Time:= 02:02:02

4th Dimension to SQL:

4th DimensionSQL
Date:= 01/01/01Time:= 02:02:02
Date= NULLDate:= 13/11/85
Time:= 10:56:00Date= "13-NOV-85 10:56 A.M."
Date:= 13/11/85Time:= 02:02:02
Date= "13-NOV-85"Date:= 01/01/01
Time:= 10:56:00Date= "10:56 A.M."


4D - Documentation   Français   English   German   English   4D for Oracle, Command Theme List   4D for Oracle, Command Alphabetical List   Back   Previous   Next