Adding Plant Database Functions

The Plant Database connector is packaged with a set of standard functions, also referred to as procedure calls. Each function extracts specific information from the database. See Plant Database Functions for information on these functions. You can make changes globally to the standard set of functions when a Plant Database data source is first configured in the Administration application. For more information, see Configuring Standard Plant Database Functions.

In some cases you may want to create your own functions. In the Administration application, you can define your own procedure call (function) and select where you want it to appear in the mirrored Data Model tree. In addition, for each parameter you can provide the following:

The columns that are returned with the customized functions can also be given different names and/or can be hidden.

CAUTION: Changes made to user-defined functions that are already configured in a display may cause errors in the display.

Before you can add a new Plant Database function, make sure you have done the following:

For more information on how to use Proficy Portal's SQL Statement Builder, see Building Statements.

Refer to the following for detailed descriptions of the properties on the Procedure Call Configuration dialog box:

Procedure Call Configuration Properties 

Property

Description

Procedure Call Name

The name of the function as it will appear in the Data Source Browser and Data Sources tree.

Data Model Node Type

The level of the mirrored Plant Model that the function will appear at.

 

Procedure Call Configuration Properties: Parameters Tab

Property

Description

Name

Displays the name of the parameter.

Type

Displays the data type of the parameter.

I/O

Displays whether the parameter is of type Input or Output. This is set on the original stored procedure. You cannot configure default values for Output parameters.

Description

Specifies the name of the parameter that will appear on the Configuration dialog box when the function is used with an object.

Default Value

Specifies the default value for the parameter that appears on the Configuration dialog box when the function is used with an object. The value must be valid according to the type of data that the function retrieves.

Fixed

Indicates whether the default parameter value is fixed. If the parameter is fixed, the parameter will not appear on the source configuration dialog box. However, the parameter will still be available for linking purposes (that is, it will appear in the Link Property to dialog box).

Parameter Type

Specifies the type of parameter, and therefore the specific type of dialog box that will be shown when the parameter default is modified.

This cannot be changed when configuring standard functions. For more information, see Configuring Standard Functions.

 

Procedure Call Configuration Properties: Results Tab

Property

Description

Column Name

Displays the column name.

Column Description

Specifies the name of the column as it appears on an object, such as the header on a grid.

Hidden

Indicates whether the column is available to be used in an object. If you select the Hidden check box, the user will not see the column while configuring this data source for an object.

To add a Plant Database Function

  1. If you have not already done so, create a Plant Database data source. How?

  2. Click the Configure Functions button. A list of user-defined procedure calls (functions) appears if there are any.

  3. Click the Add button. The Open Statement dialog box appears.

  4. Select the stored procedure and click Open. The Procedure Call Configuration dialog box appears.

  5. In the Procedure Call Name box, enter a meaningful name for the function.

  6. From the Data Model Node Type drop-down list, select the node under which you want the function to appear (in the Data Sources tree or the Data Source Browser).

  7. For each parameter, you can do the following:

    • Enter a name in the Description box.

    • Enter a default value.

    • Indicate whether the default value is fixed.

    • In the Parameter Type field, select a type for the parameter.

  1. Click the Results tab. A list of all columns names and descriptions appears.

  2. For each column, you can do the following:

    • Enter a new name in the Column Description box.

    • If you want the column to be hidden, select the Hidden check box.

  1. Click OK to save your changes.

  2. Click Save to apply your change to the data source.

TIP: If you want to create a Plant Database function that has a similar configuration to another function, select the similar function and click the Copy button. If you want to make changes to a user-defined function, select the function and click the Edit button. If you want to delete a user-defined function, select the function and click the Remove button. Be aware that changes made to user-defined functions that are used in a display can cause errors in the display.

See Also

Adding a Plant Database Data Source

Using Plant Database Data Sources