Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
colinodonnel
Creator
Creator

SQL IF EXISTS

Hello there,

I am loading tables a bunch of tables via SQL, including 1 from SQL Sandbox (a temporary table).

When running the extract app, the script fails if the Sandbox temporary table does not exist.

How can i amend the Qlik Script to ignore this error so the Load script does not fail.

Thanks,

Colin

 

Labels (2)
1 Solution

Accepted Solutions
Or
Champion
Champion

Set ErrorMode = 0;

SQL Select * From SandboxTable;

Set ErrorMode =1;

Note that this will ignore any error during the SQL load and the data from that table will not be available if the select failed (so you won't be able to further load from it or reference it using Resident etc.)

https://help.qlik.com/en-US/sense/November2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVaria...

 

View solution in original post

2 Replies
Or
Champion
Champion

Set ErrorMode = 0;

SQL Select * From SandboxTable;

Set ErrorMode =1;

Note that this will ignore any error during the SQL load and the data from that table will not be available if the select failed (so you won't be able to further load from it or reference it using Resident etc.)

https://help.qlik.com/en-US/sense/November2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVaria...

 

colinodonnel
Creator
Creator
Author

That is perfect. 

Thank you,

Colin