Using Multiple Databases
You can use iFIX ODBC to access several different relational databases you have installed in your configuration. In this mode, the command and error log table can also be located in the same account. However, the tables must use a consistent naming convention. For example, if you name the SQL command table SQLLIB in one relational database, you must use this name in the other relational databases.
You can store recipes to download in an Access database and log plant values in an Oracle database.
To define this configuration:
- 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 ACC_DB and ORA_DB.
- In the SCU, configure two SQL accounts (one for each data source). The Database ID field should be the data source names defined in the previous step: ACC_DB and ORA_DB.
- In the SQL Task Configuration dialog box, leave the Database ID field blank.
- In each SQT block, in the Database ID field, type the appropriate database ID to access the relational database.
The SQL Task Configuration does not include a reference to a database identifier. Instead, define the relational database in the Database ID field of each SQT block.
When SQT1 triggers, the configured command executes in the database, ACC_DB, defined in the block configuration. In this example, the chain triggers a recipe download. The blocks defined in the SQD block accept the downloaded recipe values. The iFIX database chain for SQT2 logs plant values to the Oracle database using ORA_DB as the Database ID.