Hi Team,
Is it possible to run SQL(sql is like - select and some condition between 5 tables in cloud database) in expression rule as array values-> to execute other expressions rule in unnamed rule. If possible, please share some example
let assume I'm currently queried data using sql and takes the one of the columns and adding into my custom unnamed rule input. Problem is that its take more time.
If its possible to queries the data using same sql statement as one of the parameters that will save my time
eg:
a!localvariables(local!result,a!queryRecord(sql: "SELECT id FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id JOIN table3 t3 ON t2.id = t3.id JOIN table4 t4 ON t3.id = t4.id JOIN table5 t5 ON t4.id = t5.id WHERE t1.column1 = :value1 AND t2.column2 = :value2",parameters: a!queryRecordParameters(value1: "some value",value2: "another value"),fetchSize: -1));
so i assume if that local!result contains the same id which i runed in sql that will helps me
Regards,
Vigneshkumar.Radhakrishnan
Discussion posts and replies are publicly visible
I cannot follow. Yes, you can query data using Appian functions. You can add conditions and aggregations. When you explain in more detail what you want to achieve, I am sure we can help.
Thanks Stefan, for your reply. let assume I'm currently queried data using sql and takes the one of the columns and adding into my custom unnamed rule input. Problem is that its take more time.
a!localvariables( local!result, a!queryRecord( sql: "SELECT id FROM table1 t1 JOIN table2 t2 ON t1.id = t2.id JOIN table3 t3 ON t2.id = t3.id JOIN table4 t4 ON t3.id = t4.id JOIN table5 t5 ON t4.id = t5.id WHERE t1.column1 = :value1 AND t2.column2 = :value2", parameters: a!queryRecordParameters( value1: "some value", value2: "another value" ), fetchSize: -1 ));
You cannot run SQL code in Appian. Technically you can using the Query Database node, but I do not recommend that.
What do you mean with "Problem is that its take more time. "?
Do you want to implement a specific query, or try to understand how to query a database in Appian in general?
Thanks for update.
Do you want to implement a specific query, or try to understand how to query a database in Appian in general? - Yes, in terms of 1000+ rows while using the same in each foreach its takes more time to execute and copy and paste row id also takes more items so, i tried to use this kind of approach but i think direct SQL will not support in Appian Expression rule
The query you defined above can absolutely be configured in Appian without writing SQL. I'd recommend looking at the query recipes to see some examples: docs.appian.com/.../Query_Recipes.html
I still have a hard time understanding the purpose of this. What do you want to achieve?