Global Scripts

Global scripts enable certain aspects of the Data Model Designer, such as using database views, without having direct access to database management tools.

The global scripts associated with a data model will also be executed when the data model is imported in order to create the missing SQL objects.

  • In the Administration section , click Global Scripts in the left pane.

To create a new script:

  1. In the Global Scripts drop-down menu, select Manage Scripts.

  2. In the upper left hand corner, click Create New Script. If you click to update an existing script, the same Edit window will appear.

  3. Enter the parameters as described below.

  4. Once the form has been completed or changed, click Update or Create to finish.

Parameter Description
Description Name of the Global Script.
Parameters to Add Automatically populated from the list of parameters defined in the Parameters of Scripts, the parameters can be used to dynamically change the content of the scripts when executed. Subsequently, a Parameter window will appear to let the user enter the values for each parameter in the script.
Script Content Contains the query that will run.
Rollback Script Content Contains the backup query in case the query in the script content does not complete successfully or if the templates are uninstalled.
Server Type Indicates the language of the script (T-SQL for either SQL Server, ISeries or Oracle).
Special Script for Template Indicates whether this script should be saved in the export as a special script. The special scripts are executed before the scripts specific to the processes. Check the box for the Data Source menu to appear.
Data Source Select the data source from the drop-down list. Always execute a script against a data source (set up at the data model level).

Parameters

The Parameters option will list all the parameters defined and applicable from the global scripts.

To create a new script parameter:

  1. In the upper left hand corner, click Create New Parameter.
  2. Enter a unique Parameter Name and Description.
  3. Click Create to finish. The new script parameter will appear in the first line of the list.

Executing a script

To execute a script:

  1. Go to Env. & Data Sources.
  2. Follow the instructions to add a new environment to match the global script you just created.
  3. Click Execute Scripts.
  4. Click Run to execute the script.