Syntax Rules for Column Descriptions
<output_column_list> ::= <output_column> | <output_column> <output_column_list>
Use this syntax rule in a DATAEXTRACT command to describe the columns to be unloaded of a source table and the representation of the data records in the data stream.
· The columns can be in any order in the column description.
· The column list can only contain columns from the SELECT statement (select_expression) or a subset of them.
· Values are output only for those columns in the column list. If the column list contains more columns than the SELECT statement, the SAP DB Loader generates an error and terminates the command.
· If you do not describe the columns of the source table in the command, you must not specify the OUTFIELDS key word.The data is output as plain text values.
· If you have defined the format COMPRESSED for the data stream, the values of the columns to be extracted are output in the order in the SELECT statement, and separated with separators.
· If you have defined the format FORMATTED for the data stream, the values of the columns to be extracted are formatted and output in the order in the SELECT statement. The length of the individual output values depends on the defined sizes of the individual columns in the source table.
· If the SELECT statement does not contain any column names (DATAEXTRACT * FROM ...), the columns are formatted according to the format of the data stream. They are output in the order specified by the database for processing the command.
Definition of the source table:
create table customer (cno char (4), name char (6) NOT NULL, zip integer, city char (11), PRIMARY KEY (cno))
Unload command:
DATAEXTRACT * from customer
OUTFIELDS
cno 01-04
name 06-12
zip 14-18
city 20-31
OUTSTREAM 'customer.data' FORMATTED;