Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
RanjithMeda
Contributor II
Contributor II

How to run multiple postgresql refresh materialized views in a given order

Hello,

I am trying to run five

postgresql

refresh materialized views in a particular order.

Is it possible to do it using tDBRow component? Please help me understand how

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello,

Could you please have a look at this KB article about mutiple SQL statement's in a BEGIN/END block.

https://community.talend.com/s/article/Executing-multiple-SQL-statements-with-one-tOracleRow-compone...

Or you could create a store procedure and call the store procedure with tpostgresqlSP.

Hope it helps.

Best regards

Sabrina

View solution in original post

2 Replies
Anonymous
Not applicable

Hello,

Could you please have a look at this KB article about mutiple SQL statement's in a BEGIN/END block.

https://community.talend.com/s/article/Executing-multiple-SQL-statements-with-one-tOracleRow-compone...

Or you could create a store procedure and call the store procedure with tpostgresqlSP.

Hope it helps.

Best regards

Sabrina

UName1615412505
Contributor
Contributor

1-Create a connection with tpostgresqlConnection first (Make sure that the MV are in the schema provided here)

2-Add tJDBCTableList => in Advanced settings use the filter or Regex filter with include ( just put the names of your tables seperated with a "|" for exqmple ("table1|table2|table3") in the order you want)

3- Add an iterate link to your tDBRow

4- Add the SQL query :

"REFRESH MATERIALIZED VIEW " + ((Integer)globalMap.get("tJDBCTableList _1_CURRENT_TABLE"))

 

 

Also you can use tforEach => add your MVs there and then use the component variable in your query