Oracle: If Table Exists

后端 未结 15 1475
无人共我
无人共我 2020-11-22 13:32

I\'m writing some migration scripts for an Oracle database, and was hoping Oracle had something similar to MySQL\'s IF EXISTS construct.

Specifically, w

15条回答
  •  迷失自我
    2020-11-22 14:24

    You could always catch the error yourself.

    begin
    execute immediate 'drop table mytable';
    exception when others then null;
    end;
    

    It is considered bad practice to overuse this, similar to empty catch()'es in other languages.

    Regards
    K

提交回复
热议问题