Refresh Command

The refresh command enables you to drop and recreate all of the stored procedures for the tables associated with the given data set in the specified data source. It is a variation of the runscripts command that is designed to run portions of the DATABridge Client scripts (script.drop.tablename and script.create.tablename). This command is useful when you want to add a new column to a table after a DMSII reorganization.

Note: In case of variable-format data sets, the tables for all the record types that have their active column set to 1 in the DATASETS client control table, are refreshed.

Refresh
command
format

The format of the refresh command is as follows:

dbutility [options] refresh datasource dataset

List of options

The list of options is the same as those for signon_options.

If a dataset of _ALL is specified, the DATABridge Client refreshes the stored procedures for all active tables that correspond to data sets whose active columns are 1. If a specific data set is specified, the DATABridge Client refreshes only the stored procedures for the tables mapped from that data set. All data sets specified must already exist.

Sample run

15:05:48 dbutility reload demodb demodb.cct
15:05:48 DATABridge Client version 6.1.0.0 [OCI/Oracle]
15:05:48 Copyright (C) 2010 by Attachmate
15:05:48 Current date is: Mon Mar 22, 2010
15:05:49 Reloading Control table entries for DataSource DEMODB from file "demodb.cct"
15:05:51 Control tables for DataSource DEMODB reloaded from file "demodb.cct"
15:05:51 Client exit code: 0 – Successful

In this case, the data set CUSTOMER is mapped to a single table named customer. The refresh command executes the following SQL statements:

begin drop_proc('d_customer'); end;
begin drop_proc('i_customer'); end;
begin drop_proc('u_customer'); end;
create procedure u_customer ( ... ) update customer set ... 
where ... ; end;
create procedure i_customer ( ... ) insert into customer ( ... ) values ( ... ); end;
create procedure d_customer ( ... ) delete from customer
where ... ; end;

This effectively replaces all of the stored procedures with a fresh copy, while leaving the tables unchanged. This command is particularly useful when the index of the tables has changed. For example, if the data set CUSTOMER initially uses AA values as keys, and a DMSII garbage collection occurs, you can avoid recloning this data set if it is mapped to a single table by creating a composite key.