Next
Topic: Running the SAND CDBMS Data Loader (ndlm) |
Load
Specification Script Examples
The following simple script imports records composed of five fixed-length
fields. Note the ASCII new-line character (\n) indicating the end of the record.
import @/VOL01/data/sample_table.ndl
{RECORD
{
col1 8
col2 2
col3 4
col4 7
col5 128\n
}test.sample_table
{
aname col1
small col2
number col3
fraction col4
large col5
}}
The following example takes a date field from the input file and decomposes it for import into additional columns for year, month, day. Time data is similarly subdivided into hour, month, and second fields.
Sample input record:
2002-05-1109:30:00
Load specification script:
IMPORT @datetime.dat
{
RECORD
{
DATE 10
YEAR (DATE:1:4)
MONTH (DATE:6:2)
DAY (DATE:9:2)
TIME 8 \n
HOUR (TIME:1:2)
MINUTE (TIME:4:2)
SECOND (TIME:7:2)
}
sample.datetime
{
DATE DATE
YEAR YEAR
MONTH MONTH
DAY DAY
TIME TIME
HOUR HOUR
MINUTE MINUTE
SECOND SECOND
}
}Results:
DATE YEAR MONTH DAY TIME HOUR MINUTE SECOND 2002-05-11 2002 05 11 09:30:00 09 30 00
Next
Topic: Running the SAND CDBMS Data Loader (ndlm) |