Storing Commands Centrally

Multiple database support can store all the SQL commands and errors in one location. You can then run these commands to access data in other relational databases. For example, you can store all of your configured commands in one Access database, the recipes to download in another Access database, and log plant values to an Oracle database.

To define this configuration:

  1. In the Control Panel, select Administrative Tools, and then Data Sources (ODBC). Select the System DSN tab, and click add to create an ODBC data source for each relational database. For example, the data sources can be called CMD_DB, ACC_DB, and ORA_DB.
  2. In the SCU, configure three SQL login accounts (one for each data source). The Database ID field should be the data source names defined in the previous step: CMD_DB, ACC_DB, and ORA_DB.
  3. In the SQL Task Configuration dialog box, define CMD_DB as the Database ID field. The list of configured Database IDs in the Accounts dialog box is presented when the browse (...) button is selected.
  4. In each SQT block, in the Database ID field, type the appropriate database ID to access the relational database. For example, if the command is executed in the Access database, then for the SQT block, in the Database ID field, type ACC_DB.

Refer to the Configuration for Multiple Databases figure to view the information you need to define in the SCU to use two different relational databases. The Database ID in the SQL Task Configuration refers to the relational database table that is used to store all the SQL commands that are used with all of the relational databases. The SQT block Database ID field defines where the command is executed. The following figure illustrates the information you need to define in the SCU to use a relational database to store all the SQL commands.

When executing a SQL command, the command is retrieved from the CMD_DB database and executed in the relational database specified in the SQT block.

See Also

How Do I...