Background documentationUPDATE COLUMNS Command Locate this document in the navigation structure

 

You can use the Loader command UPDATE COLUMNS to update the values of individual columns in tables.

Prerequisites

The table whose column values you want to update must be in the database.

Structure

Syntax Syntax

  1. <update_columns_command> ::=
      UPDATE COLUMNS TABLE <table_name>
        [<if_condition>]
        <update_column_spec> ...
        <set_column_spec> ...
        <data_instream_column_spec>
    
    <update_column_spec> ::=
      <map_field_column>
    | <column_assignment>
    
    <set_column_spec> ::=
      SET <import_column_spec>
    
    <data_instream_column_spec> ::=
      DATA <instream_columnformat_spec> [<import_lobcolumn_spec> ...]
End of the code.

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 map_field_column qualification columns, each row in the target table that is identified using the value(s) of the qualification column(s) of this data record is updated for each data record in the data stream. 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) have also been written to the log area of the database.

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

Example

Loader Tutorial, UPDATE COLUMNS