WebSphere Message Brokers
File: ac07000_
Writer: Karen Cameron

Task topic

This build: July 31, 2007 21:17:53

Accessing databases from ESQL

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:

INSERT statement
The INSERT statement adds a row to a database table.
UPDATE statement
The UPDATE statement changes one or more values stored in zero or more rows.
DELETE FROM statement
The DELETE FROM statement removes zero or more rows.
SELECT function
The SELECT function retrieves data from a table.
CALL statement
The CALL statement invokes a stored procedure.
PASSTHRU statement
The PASSTHRU statement can be used to invoke administrative operations, such as creating a table.
PASSTHRU function
The PASSTHRU function can be used to invoke complex selects.

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.

z/OS platform 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.

Related concepts
Message flows overview
User database connections
Related tasks
Configuring databases
Configuring globally coordinated message flows
Editing configurable properties
Related reference
Supported databases
mqsicreatebroker command
mqsisetdbparms command
Built-in nodes
Support for UNICODE and DBCS data in databases
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:17:53

ac07000_ This topic's URL is: