Hi, You cannot do this from Queryman, no matter what version you are using. The only option is to use BTEQ for this operation. You can use something like below:
SELECT 1 FROM DBC.TABLES WHERE Databasename = '' AND Tablename (= '' or like '%%'); .if activitycount = 0 then .goto no_tab; .if errorcode <> 0 then .goto unsuccessful_end;
DROP TABLE $dwh.table_name; .if errorcode <> 0 then .goto unsuccessful_end;
.label no_tab; - - - - - .label unsuccessful_end; exit 12; In this case, if the first query returns any row, it means the table exists and hence activitycount <> 0, the the control continues below and drops the existing table. If the table does not exist, then the first query does not return any data and hence activitycount = 0 wherein the control is transferred to the part with label no_tab which has already skipped the section with the DROP and hence DROP statement will not execute. Hope that helps.