Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
anseglko
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?

Labels (5)
3 Replies
trdandamudi
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;

 

anseglko
Creator
Creator
Author

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.

SatyaPaleti
Creator III
Creator III

 @anseglko Brother I had same requirement did u got the solution for this. Plz respon