Cloud database - select SQL with some condition in 5+ tables to run in Expression rule

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

Parents
  • 0
    Certified Lead Developer

    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. 

    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

Reply
  • 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. 

    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

Children