1 BEGIN 2 FOR c IN ( SELECT COLUMN_NAME cn FROM all_tab_columns WHERE table_name = '表名' ) 3 loop 4 BEGIN 5 execute IMMEDIATE 'alter table 表名 rename column "' || c.cn || '" to ' || c.cn; 6 EXCEPTION 7 WHEN others THEN 8 dbms_output.put_line ( '表名' || '.' || c.cn || '已經存在' ); 9 10 END;11 12 END loop;13 END;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/39225.html
標籤:Oracle
