I am trying to create a dynamic SQL in a way that I have not attempted before. I need to dynamically pass the sql and the input values for it.
For eg:
The dynamic SQL adapter will have a variable called ${SQLSTRING} that accepts the following SQL. The SQL itself requires have dynamic input as shown below.
SELECT STEP_TXT
FROM STEP STP
WHERE STEP_NM = ${STEPNAME}
Is there a way to create a dynamic adapter in which I can provide the SQL and the input values for it or do I have to manually pluggin the input values before calling the dynamic SQL adapter?
If I understand your question you would have to populate the field name / value assignments in the dynamic portion of your SQL statement before passing it to the dynamic SQL adapter service’s input. Using your example:
SELECT STEP_TXT
FROM STEP STP
WHERE STEP_NM = ${STEPNAME}
and assuming that STEPNAME would be populated with a sub-select such as
(select step_nm from foo where bar = ‘baz’)
then you would have to build the string above in your flow service before passing it as the input STEPNAME. You cannot (to my knowledge) pass:
(select step_nm from foo where bar = ?)
and an additional input value to provide the value ‘baz.’ I’d love to be wrong but I don’t think I am.