I'm a business user who creates a report of when 15 tables in a system are refreshed and send it out on a daily basis. One particular table is dropped and rebuilt completely, and due to datasize and indexing, paritioning, etc it takes several hours before I can access it in the morning, which is when my business users need it most. Essentially, what I'd like to do is to create a query that allows me to use the dual table instead of Table_XYZ when Table_XYZ is unavailable, as I just want to put in some default values into my report. If I can prepare this SQL correctly, it will allow me to use it in a scheduled Qlikview report so I no longer have to send daily e-mails with the status update.
The below is not meant to be read as being in SQL. I just included it to try to explain what I am trying to accomplish.
IF
( SELECT 'TABLE_XYZ' as TABLE_NAME, MAX(TIMESTAMP) AS TIMESTAMP
FROM TABLE_XYZ )
DOES NOT EXIST
THEN
(SELECT 'TABLE_XYZ' as TABLE_NAME, '' AS TIMESTAMP
FROM DUAL )
Any guidance would be appreciated.