Entering content frame

 column_id_spec 

Syntax Rules for Column Descriptions

Syntax

<column_id_spec> ::= <column_id > <field_pos > <format_spec > <null_assign >

Use

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.

Note the following rules:

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 Loader generates an error and terminates the command.

Format of the Data Stream: COMPRESSED

·         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 Loader generates an error and terminates the command.

DATAEXTRACT * from customer
OUTFIELDS
  cno       1
  last name 2
  zip       3
  place     4-31
OUTFILE 'customer.data' COMPRESSED

·         Assign position 1 to the first column in your list. The position numbers of the following columns increase 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 Loader generates an error and terminates the command.

DATAEXTRACT * from customer
OUTFIELDS
  cno       1
  last 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
  last name 2
  zip       3
  place     4
  last name 5
OUTFILE 'customer.data' COMPRESSED

Format of the Data Stream: FORMATTED

·        Specify all position descriptions with exact start and end positions.

·        Specify only ascending, non-overlapping values for position descriptions.
If the positions entered are not consecutive, the Loader fills the gaps with blank characters. This also applies to binary data.

DATAEXTRACT * from customer
OUTFIELDS
  cno        01-04
  last 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.

 

Leaving content frame