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:
Parameter name.
Default value and whether the default is fixed. If the default is fixed, then the user will not see the parameter when the data source is configured for an object; however, the parameter is still available when linking objects.
Parameter Type (e.g. Unit ID, Variable ID, and so on).
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:
Set up an SQL connector to a Plant Database. See Adding an SQL Data Source for more information.
Set up a schema containing stored procedures of the API.
Create a statement that is the stored procedure call that will become the Plant Database function.
Execute the statement in the Statement Builder and check that the result set structure is correct.
Save it again so that the result columns are noted.
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:
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. |
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. |
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. |
If you have not already done so, create a Plant Database data source. How?
Click the Configure Functions button. A list of user-defined procedure calls (functions) appears if there are any.
Click the Add button. The Open Statement dialog box appears.
Select the stored procedure and click Open. The Procedure Call Configuration dialog box appears.
In the Procedure Call Name box, enter a meaningful name for the function.
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).
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.
Click the Results tab. A list of all columns names and descriptions appears.
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.
Click OK to save your changes.
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.