Previous Topic: Define a DB2 LUW NicknameNext Topic: Define a DB2 LUW Index


Define a DB2 LUW Global Variable

Use the DB2 for LUW Global Variable Editor to define and set properties for global variables.

Note: This topic applies to DB2 for LUW versions 9.5 and 9.7 only.

To define a DB2 LUW global variable

  1. Right-click a global variable in the Model Explorer and select Properties.

    The DB2 for LUW Global Variable Editor opens.

  2. Select a global variable and work with the following options:

    Note: Click New New icon in property editors to create a new object on the toolbar to create a global variable. Use the Enter filter text text box to filter a large list of names to locate the one you want to work with.

    Name

    Specifies the name of the global variable.

    Schema

    Specifies the schema you want to associate with the global variable. Create or select a schema from the drop-down list.

    Physical Data Type

    Specifies the data type of the selected global variable. Select a data type from the drop-down list.

    Use Replace Syntax

    Specifies that Forward Engineering will use the CREATE or REPLACE command instead of the CREATE command.

    Note: This field applies to DB2 for LUW version 9.7 only.

    Generate

    Specifies whether or not to generate DDL for this object during Forward Engineering.

  3. On the General tab work with the following properties:
    Initial Value

    Specifies the initial value of the variable. Enter a value that is relevant for the Physical Data Type you have selected.

    Is Initial Value Constant

    Specifies whether or not the initial value is a constant. Select the check box if the value is a constant.

    Is Valid

    Specifies whether or not the variable is still valid in the database.

    Character Type

    Specifies whether or not the character type data is for binary.

    Anchored To Type

    Specifies the type of data to which the variable is anchored. Select from the drop-down list. The valid values are: Variable, Column, Table Row, View Row, and Cursor Variable.

    Global Variable

    Specifies the global variable to which the selected variable is anchored. This field appears only when you set the value for the Anchored To Type field as either Variable or Cursor Variable.

    Abstract Entity

    Specifies the name of the table for the anchored column. This field appears only when you set the value for the Anchored To Type field as Table, Column, or View Row.

    Column

    Specifies the name of the anchored column for the variable. This field appears only when you set the value for the Anchored To Type field as either Column Row.

  4. Click the Permission tab to associate a specific permission with the global variable.
  5. (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
  6. (Optional) Click the Where Used tab to view where the object is used within the model.
  7. (Optional) Click the UDP tab to work with user-defined properties for the object.
  8. (Optional) Click the Notes tab to view and edit user notes.
  9. (Optional) Click the Extended Notes tab to view or edit user notes.
  10. Click Close.

    The DB2 for LUW Global Variable Editor closes.

More information:

Add a Comment in a Property Editor

Add a UDP in a Physical Property Editor