I have a query that pulls relevant configuration codes from the database. Because I run this code against different releases of the database and some of the older releases do not have all the tables the newer ones do, I want to see if I can write a clause to handle if the table does not exist. Example shown below is only two of 75 unioned queries. If one of the 75 tables is not in the release, the entire script fails.
Is there a way to do Case when SYT_SYSTEM_TABLE does not include table, then skip else run the query? What every I end up with, it has to be self correcting, because the query is embedded into an Excel Spreadsheet data connection and the user can't make modifications.
Using Oracle 11g. Can not use PLSQL.
SELECT 'ANC' AS WB, 'NCR' AS TBL, NCR_CODE AS CODE, NCR_DESC AS DESCRIPTION, 'NA' AS MEANING, NCR_RECORD_STATUS AS STATUS FROM NCR_NEW_CASE_RESPONSE
UNION
SELECT 'CMDM' AS WB, 'PDR' AS TBL, PDR_CODE AS CODE, PDR_DESC AS DESCRIPTION, 'NA' AS MEANING, PDR_RECORD_STATUS AS STATUS FROM
PDR_PROG_DISENROLLMENT_REASON
Thanks