Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: timonkGood Day,
Unfortunately, while the DB Execute node does have the ability to directly access its node input to set values in your sql query (or the whole query itself):
sqlSelect(1, 'QUERY')
#where QUERY is a string field on an input actually containing the sql query.
The JDBC nodes do not have that same ability. So you cannot dynamically construct an entire query and pass it diectly into the JDBC nodes.
You do have some ability to parameterize your JDBC query, however, using the special '?' character substitution for the SqlQueryFieldBindings node parameter. Please see the attached example graph.
Query nodes will run their queries once for each attached input row. Using the substitution character, you can write a query and make some changes to your selected values based on those input records. The attached example makes use of this for 2 fields. (Please note that it was setup specific to a test environment , so it won't work if you just try and run it, but syntactically it is correct so you can use it as a guide)
An enhancment request has been put in to allow for direct access to input fields similar to the DB Execute node.
Regards
Timon Koufopoulos
MDA Support
Attachments:
JDBC Query example.brg