Skip to main content

Global Scripts

Global scripts enable certain features in the Data Model Designer, such as using database views, without requiring direct access to database management tools.

The global scripts associated with a data model are also executed when the data model is imported, to create any missing SQL objects.

When to use global scripts

  • Automating SQL object creation: Make sure that necessary database views, stored procedures, or functions are automatically generated during data model import or design.
  • Standardizing environment setup: Apply consistent SQL scripts across multiple environments to synchronize schema changes or required structures.

Create a script

  1. From the navigation panel, click the gear icon at the bottom. The Administration page opens.
  2. Select Global Scripts, then Manage Scripts.
  3. Click Add New Record.
  4. Enter the required fields.
  5. Click Create.

Edit a script

  1. In the Mapping Scripts window, select the script you want to edit.
  2. Click the pencil icon.
  3. Make the relevant changes.
  4. Click Update.

Delete a scripts

  1. In the Mapping Scripts window, select the script you want to delete.
  2. Click the trash icon.
  3. Click Delete to confirm.

Global scripts properties

FieldDescription
DescriptionEnter a name for the global script.
Parameters to AddSelect from the list of parameters defined in Parameters for scripts. Use parameters to dynamically change the script content when executed. When you run the script, a parameter window appears so you can enter the values for each parameter.
Script ContentEnter the query to run as the script.
Rollback Script ContentEnter the backup query to run if the main script does not complete successfully or if the templates are uninstalled.
Server TypeSpecify the target database language: SQL Server, iSeries, or Oracle.
Special Script for TemplateSelect this option if the script should be exported as a special script. Special scripts execute before process-specific scripts. After selecting, the Data Source field appears.
Data SourceSelect the data source to run the script against. This must match a data source configured at the data model level.

Execute a script

Executing global scripts on an environment allows you to create or update necessary SQL objects—such as views, procedures, or schemas—when setting up, refreshing, or synchronizing that environment. This ensures your data models work correctly in each environment without manual database intervention.

  1. Select Env. & Data Sources from the navigation panel.
  2. In the Environments panel, click the + icon to create a new environment, if needed.
    • Enter an environment name and an abbreviated name.
    • Choose the color for the environment and click Confirm.
  3. Select the environment and click the Re-execute global scripts on this environment icon.
  4. In the Execute Scripts dialog, enter the required parameter values for each script listed. Each parameter lets you tailor script execution to the specifics of the environment (such as schema or server names).
  5. Click Run to execute the scripts.

Manage parameters

The Parameters option lists all parameters defined for use in global scripts. Parameters allow you to dynamically insert values—such as environment names or schema names—into scripts, making them more flexible and reusable. When a global script with parameters runs, you are prompted to enter a value for each parameter.

If your table’s schema name varies from one environment to another, add a parameter for the schema. Then, you can run the same script everywhere and provide the correct schema name as needed.

Create a script parameter

  1. Select Global Scripts, then Parameters.
  2. Click Add New Record.
  3. Enter the paramater name and description.
  4. Click Create.