Is there any way to compile a SQL statement with String variables?

I need to refine a DataTableA, but I need to change the target items dynamically depending on the settings in an external file.

Example1
Select A,B,C
from DataTableA
Group by A having B > 100

Example2
Select A,B,D
from DataTableA
Group by D having A < 20

As you can see, depending on the condition, the Select item and the search condition also change.
Therefore, the Filter Data Table activity, which has fixed values, will not work.
Iā€™m wondering if there is a way to change the code statement of the String variable to a SQL statement as shown above, and get the filtered DataTable.

Hi @Kirigirisu_Coin

Yes you can pass the Variable in SQL Statement Instead of Hard Coded Values!

Check below For the Expression!

"select A,B,C From table_Name GroupBy A having B>ā€™"+YourStringVariable+"ā€™;"

Regards

1 Like

Ahhh, I wanted to know how to make that usable as a SQL statement through Uipath, but I guess not, since no one else has answered.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.