The PASSTHRU statement evaluates an expression and executes
the resulting character string as a database statement.
The first parameter of PASSTHRU must be a valid ESQL expression containing your database syntax. PASSTHRU allows you to use database syntax not normally supported by ESQL.
The behavior of the PASSTHRU function depends on whether you pass one, two, or more parameters. The first parameter of the PASSTHRU function must always be an ESQL expression that either is, or evaluates to, a string. Use question marks in the string to denote where any parameter substitution is required.
If you pass two or more other parameters, each parameter is bound to the corresponding question mark in the statement string: that is, the first parameter is bound to the first question mark, the second parameter is bound to the second question mark, and so on.
SET OutputRoot.XML.Result.Data[] = PASSTHRU('SELECT * FROM user1.stocktable where time=TIMESTAMP(CAST(? as TIMESTAMP)),'1999-12-31-23.59.59.999999');
SET OutputRoot.XML.Result.Data[] = PASSTHRU('SELECT * FROM user1.stocktable');
PASSTHRU('DELETE FROM user2.AccountData WHERE AccountId = ?', InputBody.Data.Account.Id);
SET OutputRoot.XML.Result.Data = PASSTHRU('SELECT AccountNum FROM user2.AccountData WHERE AccountId = ?', InputBody.Data.Account.Id);
SET OutputRoot.XML.Result.Data[] = PASSTHRU('SELECT AccountNum FROM user2.AccountData WHERE AccountId IN (? , ? , ?)', InputBody.Data.Account.Id[]);
PASSTHRU('INSERT INTO user1.stocktable (stock_id, quantity) values (?, ?)', InputBody.Transaction.Id, InputBody.Transaction.Quantity);
call procedure-name [([parameter][,[parameter]]...)]}
Only the escape sequence described above is supported for the input parameters of the PASSTHRU function in WebSphere Business Integration Message Broker.
PASSTHRU('{call proc_insert_comp(?,?)}',InputBody.Test.Company,InputBody.Test.Price);
PASSTHRU('{call share_management.add_share(?,?)}', InputBody.Test.Company,InputBody.Test.Price);
If a message flow is either committed or rolled back, the database operations are either committed or rolled back. This is consistent with the behavior of the Database and Warehouse nodes, which have a transaction property of automatic.
Even if a message flow is rolled back, the database operations are committed. This is consistent with the behavior of the Database and Warehouse nodes, which have a transaction property of commit.
For further information about coordinated transactions, see Configuring coordinated message flows.
PASSTHRU('{call proc_delete_comp(?)}',InputBody.Test.Company);
PASSTHRU('INSERT INTO user1.stocktable VALUES (1)');However, if a variable is first set and then referred to in the PASSTHRU statement, omit the quotes. For example:
SET myVar = 'SELECT * FROM user1.stocktable'; SET OutputRoot.XML.Data[] = PASSTHRU(myVar);
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
ak05100_ |