if not exists
clause to the create
SQL verb, and if exists
clause to the drop
statement which prevent errors from being thrown when creating or dropping objects (tables, views etc.). num
: create table tq84_tab (num number);
tq84_tab
if it does not already exist. Since the table aready exists, the table is not created, but the error ORA-00955: name is already used by an existing object is not thrown, either: create table if not exists tq84_tab(txt varchar2(10));
desc
command, it shows that the table's column's name is num
, not txt
. SQL> desc tq84_tab Name Null? Type ---- ----- ------ NUM NUMBER
drop table if exists tq84_tab;
if exists
clause: drop table if exists tq84_tab;
drop_if_exists.sql
that drops an object if it exists (which I used in times before 23c).