Hi all,
I have a table_1. I want to create a new table called always table_1, with different column but I also want to rename the old table_1. I have create the following trigger
create or replace TRIGGER test_trigger
before create on database
declare
v_count number;
BEGIN
select count(*)
INTO v_count
from all_tables
where table_name = ora_dict_obj_name;
IF v_count >0 THEN
EXECUTE IMMEDIATE 'ALTER TABLE TABLE_1 RENAME TO TABLE_1_OLD';
END IF;
END IF;
END;
But if I run the create script for table 1 , I have always the error that the table already exists .
Could you help me please?
Regards
Luca