Previous
Topic:
The Record Specification |
Next
Topic: Load Options: Specifying Indicators for NULL or "Empty" Values |
Setting Up the Data Load with the Load Specification Script
The Map Specification
The next section of the script (called the map specification or table section) specifies the target table for the import, and the names of the columns into which the different fields of the input record are to be loaded. The name of a column (for example, ANAME) is matched with an input field as labeled in the record section (for example, col1). If an input field is not included in the map specification, it is not loaded into the database.
The following example gives the general form of the map specification: the table name (including the schema-name prefix) is followed by the list of entries matching table columns with the fields of the input record. The entire set of mapping entries must be enclosed within braces ( { } ).
test.sample_table
{
ID field1
name field2
}
This example, taken in conjunction with the RECORD section described above, instructs ndlm to load the first eight characters of the record (field1) into the ID column in the table sample_table (which belongs to the test schema), and any remaining characters before the new-line character (field2) into a column called name in the same table.
Note:
SAND CDBMS features an extensive data-load scripting language called NDL++, which supports string and math functions, variables, and conditional expressions. These are briefly described here; consult the SAND CDBMS Tools Reference Guide for more detailed information about NDL++ scripts.