Entering content frame

Syntax documentation UPDATE COLUMNS Command Locate the document in the library structure

You can use this Loader command to update individual column values in tables.

Prerequisites

The table whose column values are to be updated must be available in the database instance.

Syntax

<update_columns_command> ::= UPDATE COLUMNS TABLE <table_name>
                             [<if_condition>]
                             <update_column_spec> ... <set_column_spec> ...
                             <data_instream_column_spec>

<table_name>             ::= table name

<if_condition>           ::= selecting data records

<update_column_spec>     ::= <map_field_column>
                           | <column_assignment>
<map_field_column>       ::=
column description
<column_assignement>     ::=
column description

<set_column_spec>        ::= SET <import_column_spec>
<import_column_spec>     ::=
column description

<data_instream_column_spec>   ::= DATA <instream_columnformat_spec>
                                       [<import_lobcolumn_spec> ...]
<instream_column_format_spec> ::=
data stream
<import_lobcolumn_spec>       ::=
importing LONG values

Examples

Loader Tutorial, Structure linkUPDATE COLUMNS

Explanation

The Loader generates an internal UPDATE statement from the UPDATE COLUMNS command and then executes it.

<update_column_spec>, <set_column_spec>

You use the syntax rule update_column_spec to define the qualification columns.

The qualification columns must be listed before the target columns set_column_spec in an UPDATE COLUMNS command.

If you use qualification columns map_field_column , for each data record in the data stream each row in the target table is updated that is identified using the value(s) of the qualification column(s) of this data record. You therefore use the syntax rule map_field_column to assign the data fields of the qualification columns in the data stream to the columns in the target table and can thus specify the external data types.

Result

The individual row values in the specified table columns are updated. All of the changes made to the target table(s) as a result have also been written to the log area of the database instance.

Errors

If errors occur while a UPDATE COLUMNS command is being executed, the Loader terminates the process and displays an error message. A log file is written.

See also:

Log File

 

Leaving content frame