How to add a variable/insert new variable every time in SQL query?

Hello,

I am currently working on a process where I will be pulling data from a database, then reuploading that data to the orchestrator queue, and then pulling each account number from orchestrator queue to do a lookup of it on a separate database. What I need help with is how do I do the part where I am looking up a separate queue account number every time? Please help!

Hello,

if you’re using SQL query you can simply save the query as String and use String.Format() method. That way you can have dynamic text inside a string.

Best,

Artur

Could you give me an example? I would also like to store this query in an asset. Would it be possible to have it stored in an asset and then do that?

Here you go:

Assign

StrFilter = “TEST”

SqlQuery = String.Format(“SELECT * FROM {0}”, StrFilter)

You can of course store the query as Asset and retrieve it using Get Asset.

Best,

Artur

1 Like

Thank you!