Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Ignore a table that doesn't exist in data load script

I have connected to multiple PostgreSQL databases in load script. I'm loading data from multiple tables like 

[table1]:
SELECT * FROM "schema"."table1";
Store table1 into [lib://path/table1.qvd] (qvd);
drop table table1;

[table2]:
...

 

However some databases don't have certain tables, which results in the data loading being interrupted with an error message "Relation "table2" does not exist".

 

Is there a way to check if the table exists and skip if it doesn't in the load script?

2 Replies
Highlighted
Master II
Master II

One way is you can use ErrorMode, something like below:

 

//Set ErrorMode to 0 so that it does not halt on error
Set ErrorMode=0;

           Your load statements here <---

// Set ErrorMode back to default to 1
set ErrorMode=1;

 

Creator
Creator

Thanks, I tried this but it doesn't work. It will skip the error yes, but on the next table it shows the same error "Relation Table1 does not exist" and it won't load any tables after this.