Syntax Rules for Column Descriptions
<column_id_spec> ::= <column_id > <field_pos > <format_spec > <null_assign >
Use it in unload commands to assign the data fields of the data stream to the columns of the source table. You specify the external data types and the conditions for unloading the application data.
Decide whether you want your column descriptions to contain field_pos field descriptions.
However, you must specify position descriptions for all or none of the described columns. If you do not, the SAP DB Loader generates an error and terminates the command.
· Enter the position descriptions as relative positions only.
If you enter position descriptions with start and end positions for single columns or all columns, the SAP DB Loader generates an error and terminates the command.
DATAEXTRACT * from customer
OUTFIELDS
cno 1
name
2
zip 3
place 4-31 ERROR
OUTFILE 'customer.data' COMPRESSED
·
Assign
position 1 to the first column in your list.
The position numbers
of the following columns rise by 1 each time.
This also means that
each position number can only be assigned once.
If you do not keep
to these rules, the SAP DB Loader generates an error and terminates the
command.
DATAEXTRACT * from customer
OUTFIELDS
cno 1
name
2
street 3
zip 3 ERROR
place 5 ERROR
OUTFILE 'customer.data' COMPRESSED
· You can assign a column to multiple different positions.
DATAEXTRACT * from customer
OUTFIELDS
cno 1
name 2
zip 3
place 4
surname 5
OUTFILE 'customer.data' COMPRESSED
· Specify all position descriptions with exact start and end positions.
·
Specify only
ascending, non-overlapping values for position descriptions.
If the positions do
not follow on from each other, the SAP DB Loader fills the gaps with blank characters.
This also applies to
binary data.
DATAEXTRACT * from customer
OUTFIELDS
cno 01-04
name
06-12
zip 14-18
place 16-31
OUTFILE 'customer.data' FORMATTED
·
Define the
positions for the data stream at least as long as the length of the values in
the database.
If you define a
position for the data stream that is longer than the length of the value in the
database, the following occurs:
- Character strings are aligned left and space
characters entered to make them the correct length
- Numeric values are aligned right and space characters
entered to make them the correct length
If you define a position for the data stream that is shorter than the length of the values in
the database, the Loader generates an error and terminates the
command.