Renaming Columns

Use the DATAITEMS client control table to rename the columns that appear in the relational database. The data_item column shows the DMSII data item (column) name and the item_name column shows the name of the column as it will appear in the relational database. For an explanation of how the DMSII data set and data items are mapped to the relational database, see Relational Database Table and Column Names.

You can change one or more column names before or after cloning, as follows:

  • If you change the relational database column name immediately after you run dbutility define, continue with the remaining dbutility commands. Keep in mind, however, that the DMSII data item retains its original name in the DMSII database. It is recommended that you make this change via user scripts during the define and redefine command to ensure that your changes are not lost.
  • If you change the column name after you have already cloned a DMSII database, you must mark the table to be recloned and then rerun dbutility generate to create new scripts that contain the new column name.

    Note: Column names in Oracle are limited to 28 characters. Using a column name longer than 28 characters results in a SQL syntax error when the DATABridge Client executes the corresponding stored procedures.

Example

The following script changes the names of two columns in the table derived from the data set named ORDERS.

File name: script.user_define.orders

update DATAITEMS set item_name='order_amount'
where item_name='order_amt' and table_name='orders'

/***/

update DATAITEMS set item_name='order_date'
where item_name='order_dt' and table_name='orders'