Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello together,
i have to load SQl databases with the select order.
My problem is, that i dont know whether a column exits or not.
Example:
select
column1 as c1,
column2 as c2,
column3 as c3
from database.dbo.example;
Sometimes column3 exists in the table, sometimes not.
If column3 don´t exists, the dataload runs on an error.
How can i check, whether column3 exists, and if not how can i exclude column3 from the select order?
Thanks to all!
Frank
This isn't really a Qlik question, since it's specific to your SQL. But on the Qlik end, you could just Select * from your table and then rename using the Rename command, since Qlik won't crash if you try to rename a field that doesn't exist.
Hi @FrankGrimm
If you are just reading all the columns available probably select * from table would work, but is you want to get specific files only maybe you will need to use sys tables to verify if the column exist, and generate a dynamic query.
Hope it helps.