You can create and configure ESQL in message flows to access user databases.
You can use a number of ESQL statements and functions to access databases:
You can access user databases from Compute, Database, and Filter nodes; you can use the same ESQL statements and functions to access databases in all three types of node. A single node can access multiple databases but the following restrictions apply:
To access databases, you must ensure that suitable ODBC data source names (DSN) have been defined on the system on which the broker is running. On Linux (zSeries platform) and Linux (POWER platform), the only supported database manager is DB2 and ODBC is not used; the broker and message flows connect to the databases directly. When you configure message flows, use the DB2 alias of the database as the DSN.
If you have used the mqsisetdbparms command to set a user ID and password for a particular database, the broker uses these values to connect to the database. If you have not set values for a particular database, the broker uses the default database user ID and password that you supplied on the mqsicreatebroker command, or the user ID and password details that you specified if you have modified the broker using the mqsichangebroker command.
On
z/OS systems, the broker uses the broker started-task ID to connect to the
database. You must also ensure that the database user IDs have sufficient
privileges to perform the operations your flow requires. If they do not have
the required privileges, errors will occur at run time.
For a description of database transactional issues, see The Transactional model.
If you select the Treat Warnings As Errors and Throw Exception on Database Error check boxes, and, from the Transaction list, select Automatic, you have the flexibility to use the COMMIT and ROLLBACK statements for transaction control and handlers for dealing with errors.