Alter Scripts

A generated alter script contains the SQL DDL commands required to modify existing tables, columns, and stored procedures that bring into effect the changes that were made in the RPS mapping or mapped classes in the primary database.

The alter scripts generated by an RPS node for instantiation are created with the following format.

extract_mapping-OID/tableAlter_RPS-mapping-name_mapping-OID.sql

The mapping-OID value contains the object identifier of the RPS mapping entity and it is appended to the file name to ensure uniqueness.

The alter scripts are written to a subdirectory of the path specified in the Alter Script Path text box on the Configure RPS Node dialog in the RPS Manager application. (For details, see "Configuring your RPS Node", later in this chapter.)

Two types of alter script can be generated. The first is an auto initiate script that makes use of SQL ALTER TABLE commands to modify tables in the target. The second is a Drop/Reload script that renames any affected tables and creates new empty tables for reloading of the data.

Comments included at the top of the script describe what has changed and what actions the script will take, as shown in the following example.

-- The following change(s) to the table 'Agent'
-- new column 'webSite'
-- could cause an incompatibility between your Jade and
-- SQL databases.  Therefore this table will be renamed
-- and a new one created.  You will also need to extract
-- table data from the Jade database and load it into
-- this new table.  Table renamed rather than dropped,
-- it can be dropped manually when no longer required.

The following Jade schema changes are achieved using ALTER TABLE commands and result in an auto initiate script.

The following Jade schema changes result in a Drop/Reload script using a renaming of the old table and a creation of the new table to achieve the table redefinition.