Output Column

The syntax elements used for the Loader output columns are described below.

Syntax

<export_column_spec> := <map_column_field>
                      | <field_assignment>

<map_column_field>   ::= <column_spec> <field_spec> <field_function> <null_assign>

<column_spec>        ::= <column_name>
                       | <column_id>
<column_name>        ::= <identifier>
<column_id>          ::= <unsigned_integer>

<field_spec>         ::= Position description
<field_function>     ::= <field_type> [HEX]
                       | <numerical_functions>
                       | <field_type> [HEX] <numerical_functions>
<null_assign>        ::=
NULL value representation

<field_assignment>   ::= '<literal>' <field_spec>

<column_name>

Name of column

See the SQL Reference Manual, Column Name (column_name)

<column_id>

Column ID

See the SQL Reference Manual, Unsigned Integer (unsigned_integer)

<field_type>

Specification of the data type of a data field in the data stream

HEX

You can define the data field as a HEX value.

<numerical_functions>

You can scale numerical data values during export or import (scale_spec), round and/or truncate (round_or_trunc_spec).

  <scale_spec>
| <round_or_trunc_spec>
| <scale_spec> <round_or_trunc_spec>

See also: Column Description

<literal>

Literal

See the SQL Reference Manual, Literal (literal)

Examples

See the EXPORT COLUMNS commands section and the following sections.

Explanation

The syntax element export_column_spec is used in the EXPORT COLUMNS command. Specifications such as column name and position description are also used in the columns description of other Loader commands.

<map_column_field>

In export commands you assign the data fields of the data stream to the columns of the source table with the syntax element  map_column_field . You specify the external data types and the conditions for exporting the application data.

You use the syntax rule column_spec to specify the column name or column ID.

EXPORT COLUMNS cno, name, zip, address FROM hotel.customer
MAP COLUMNS
  
cno       01-05
  
name      06-15
  
zip       16-20
  
address   21-45
DATA OUTSTREAM 'customer_fwv.data' FWV

The column name  column_name denotes the column in the SELECT expression.

EXPORT COLUMNS cno, name, zip, address FROM hotel.customer
MAP COLUMNS
  
1  01-05
  
2  06-15
  
3  16-20
  
4  21-45
DATA OUTSTREAM 'customer_fwv.data' FWV

The column ID  column_id denotes the position of the column in the SELECT expression.

<field_assignment>

You can use the syntax element  field_assignment to define literals for output in addition to the output values in the export command.

The literal is specified in single quotation marks instead of the column name or column ID.

EXPORT COLUMNS * FROM hotel.customer
MAP COLUMNS
  'customer number:' 01-16
  cno                17-21
  title              22-28
  firstname          29-38
  name               39-48
  zip                49-53
  address            54-78
DATA OUTSTREAM 'customer_fwv.data' FWV

See also:

EXPORT COLUMNS Command