Previous
Topic:
The Map Specification |
Next
Topic: Load Options: Specifying Portions of the Input File for Processing |
Setting Up the Data Load with the Load Specification Script
Load Options: Specifying Indicators
for Null or "Empty" Values
A null indicates the absence of a value at a particular row/column position in a table. If the SAND CDBMS Data Loader encounters an "empty" input field (that is, two successive delimiters with nothing, or only "white space", between them) that is to be inserted into a column having a numeric data type, it will insert a null. Contrastingly, if an empty field or string of blanks is encountered in a field that is to be loaded into a character-type column, a string of blanks of corresponding length will be inserted.
ndlm can be instructed to consider a particular string of characters as indicative of a null; for every occurrence of this string, a null will be loaded into the corresponding table column. To declare a null indicator for the entire record:
-or-
You can also instruct ndlm to insert a null in a particular column whenever specified conditions are met, to do this, include a NULLIF field-label <condition-expression> entry after the appropriate field entry in the record specification section. The <condition-expression> argument can be any valid NDL++ expression, using functions, variables, field references, or constants (see below). Note that in NDL++ expressions, equality is designated by a doubled equals sign ( == ). When the comparison value is a constant, whether numeric or alphabetic, this value must be enclosed by single quotes ( ' ). For example:
field1 *, NULLIF field1 == 'N'
To have ndlm insert an "empty" value (character string with a length
of 0) whenever specified conditions are met, use the MISSINGIF keyword instead
of NULLIF:
field2 *, MISSINGIF field2 == 'N'
Note that nulls are not considered to be equivalent to one another, while
all strings of blanks (character fields containing an empty string or any
number of blanks) are evaluated as equivalent. This can have important consequences
when joining on a pair of columns: if blanks (or any other string) are used
to indicate missing values in a character column, then all records with missing
values in these columns will "match" one another.