iPaaS Connector Oracle Query

Is it possible to pass a field name as a parameter to an Oracle Select action?  We have a query that can change based on preconditions and the change is what field we are evaluating in a WHERE clause. 

My example is:

SELECT * FROM <some table> WHERE :Role = 'YES'

Role is not being understood as an input parameter.  Is it possible to do that here?

 

Jim

Tags sql iPaaS connector oracle
Asked by Jim Lucas on Mon 5/6/24 12:49 PM
Sign In to leave feedback or contribute an answer

Answer (1)

This answer has been marked as the accepted answer
Mark Sayers Mon 5/6/24 2:39 PM

Hello Jim,

You should be able to do this if you use the "Dynamic" option. Instead of "Select" in the action dropdown, choose "Dynamic"

then the syntax would be: SELECT * FROM TableName WHERE :Role = 'YES' 

Sincerely,
Mark Sayers
​​​​​​​Sr Support Consultant, CS

No feedback
Hi Mark,

I just tried that. I'm not getting any errors, but not getting any data either. I will check my syntax and field name spelling.

Best,
Jim
- Jim Lucas Mon 5/6/24 3:12 PM
I figured it out. The correct syntax would be:

SELECT * FROM TableName WHERE {{Role}} = 'YES'

And then point the Role parameter to its input value under the Parameters tab.
- Jim Lucas Mon 5/6/24 3:27 PM
Ah cool there you go! Thanks for the follow up that you got it working! - Mark Sayers Mon 5/6/24 3:39 PM