You use the syntax rule field_pos to describe:
· The position of the input field in the data stream when importing application data
· The position of an output field in the data stream when exporting application data
· The position of a comparison value for importing application data selectively (Selecting Data Records).
<field_pos> ::= <valSTART_POS> | <valSTART_POS> - <valEND_POS>
valSTART_POS |
Start position of a data field |
valEND_POS |
End position of a data field |
The position description depends on the format.
If the data stream has the FORMATTED format, enter only absolute start and end positions for the data fields in the data stream.
The data stream customer.data has the FORMATTED format. The data fields have a standard format and end with a line break.
Position No. |
1 2 3 4 5 6 7 8 9 .... |
|
- 3 0 0 0 M r s - - - - J e n n y - - - - - P o r t e r |
IMPORT command
IMPORT TABLE hotel.customer
DATA INSTREAM FILE 'customer.data' FORMATTED
cno 01-05
title 06-12
firstname 13-22
name 23-32
zip 33-37
address 38-62
PAGE WITH 80% USAGE
If the data stream has the COMPRESSED format, enter only relative positions for the data fields in the data stream.
The data stream customer.data has the COMPRESSED format. The data fields do not have a uniform format but are separated by commas and end with a line break.
Position No. |
1 2 3 4 .... |
|
"3000","Mrs","Jenny","Porter",... |
IMPORT command
IMPORT TABLE hotel.customer
DATA INSTREAM FILE 'customer.data'
cno 1
title 2
firstname 3
name 4
zip 5
address 6
PAGE WITH 80% USAGE
COMPRESSED is the default used by the Loader.
The data stream customer.data has the FORMATTED BINARY format.
The data fields have a standard format but do not end with a line break.
IMPORT command
IMPORT TABLE hotel.customer
DATA INSTREAM FILE 'customer.data' FORMATTED BINARY
cno 01-05
title 06-12
firstname 13-22
name 23-32
zip 33-37
address 38-62
PAGE WITH 80% USAGE