You can use this Loader command to update individual column values in tables.
The target table exists in the database instance.
<update_columns_command> ::=
UPDATE COLUMNS
TABLE <table_spec>
<simple_column_spec>... <set_column_spec>...
<data_instream_spec>
[<longfile_spec>…]
<table_spec> |
|
<simple_column_spec> |
<column_descriptor> | <column_assignment> |
<column_descriptor> |
|
<column_assignment> |
|
<set_column_spec> |
SET <load_column_spec> |
<load_column_spec> |
|
<data_instream_spec> |
DATA <instream_spec> |
<instream_spec> |
|
<longfile_spec> |
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
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.
The Loader generates an internal UPDATE statement from the UPDATE COLUMNS command and then executes it.
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.
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.
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: