Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

refresh only if you have data

Hello I would like some help with dataset update.
Today I update my dataset every 2 hours with data from a database table called table_pivot.

This table is updated several times in the bank and in some periods it is empty (it is empty for some load errors)

What I need to do before updating my dataset is to make sure the table is populated, if it contains data in it, and only if it has any data the dataset is updated. I tried making a parameter and it didn't work.
Have you had anything like that? Could you help me with a solution?

Hug and thanks



Below is an example of logic just for understanding

let
Source = if Odbc.Query("dsn=bd001", "select count(*) from table_pivot") > 0
then Odbc.Query("dsn=bd001", "select count(*) from table_pivot")
else "do not update"
in
Source