How to Pass Variables Into Queries?

Greetings,

I see there is a RAW SQL step within Decisions that I can use to query databases. While this is swell, I would like a way to pass-in variables as parameters in such a query. Is there a way to do this?

Comments

  • Hello!

    You can create what's called a Parameterized Query by navigating to Integrations > Databases > {database you wish to connect to} and click "Add Query":

    From here, you can type your SQL query and click "Add Parameter" to configure what variable will be used in the query. If connecting to a MS SQL DB, the syntax will look as follows:

    Go to the flow you want to use this query in and find the step under Integration > Database > {database you wish to connect to}. From here, you can map-in your variable as an input to the step.

    Documentation for setting-up parameterized queries can be found here: https://documentation.decisions.com/docs/parameterized-queries

    We hope this helps!

    -Gregory, Decisions Support

Sign In or Register to comment.