Entering content frame

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

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

Prerequisites

The target table exists in the database instance.

Syntax

<update_columns_command> ::= UPDATE COLUMNS
  TABLE <table_spec>
  <simple_column_spec>... <set_column_spec>...
  <data_instream_spec> [<longfile_spec>…]

<table_spec>

Table Description

<simple_column_spec>

<column_descriptor> | <column_assignment>

<column_descriptor>

Column Description

<column_assignment>

Column Description

<set_column_spec>

SET <load_column_spec>

<load_column_spec>

Column Description

<data_instream_spec>

DATA <instream_spec>

<instream_spec>

Data Stream

<longfile_spec>

Exporting and Importing LONG Values

Examples

Example

UPDATE COLUMNS TABLE hotel.customer
      
cno     1-5
  SET address 76-100
  DATA INSTREAM FILE 'customer.data' FORMATTED
      NULL      '?'
    DECIMAL    '///'
    BOOLEAN    'TRUE/FALSE'
    TIMESTAMP  ISO
    DATE       ISO
    TIME       ISO

Example

UPDATE COLUMNS TABLE hotel.customer
      
cno     1-5
  SET zip     56-75
  SET address 76-100
  DATA INSTREAM FILE 'customer.data' FORMATTED
      NULL      '?'
    DECIMAL    '///'
    BOOLEAN    'TRUE/FALSE'
    TIMESTAMP  ISO
    DATE       ISO
    TIME       ISO

The column definition of the target columns occurs using the keyword SET.

Explanation

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

<simple_column_spec>, <set_column_spec>

You use the syntax rule simple_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 simple_column_spec, 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 simple_column_spec 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:

Importing: Commands

Log File

 

Leaving content frame