create or replace procedure tpk.sp_Test_proc IS err_code NUMBER; err_msg VARCHAR (500); v_tbl_cnt NUMBER; v_tbl_valid NUMBER; Begin SELECT COUNT(*) INTO v_tbl_cnt FROM USER_TABLES WHERE TABLE_NAME IN (UPPER('Tbl1'),UPPER('tbl2'),UPPER('tbl3')); IF(v_tbl_cnt =3) THEN EXECUTE IMMEDIATE 'TRUNCATE TABLE Tbl1'; EXECUTE IMMEDIATE 'TRUNCATE TABLE Tbl2'; EXECUTE IMMEDIATE 'TRUNCATE TABLE Tbl3'; EXECUTE IMMEDIATE 'DROP TABLE Tbl1'; EXECUTE IMMEDIATE 'DROP TABLE Tbl2'; EXECUTE IMMEDIATE 'DROP TABLE Tbl3'; EXECUTE IMMEDIATE 'CREATE global temporary TABLE tbl1 ( Id Integer... )' Insert into tbl1 Select * from another_schema.Dw_table /* In this line it throws error Table does not exist */ end if; end;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)