创建表之前判断表是否存在,如果存在则删除已有表

2025-03-23 03:33:30
推荐回答(3个)
回答1:

主要是查询all_tables表的TABLE_NAME和OWNER,如果表存在,则执行execute immediate 'drop table TABLE_NAME';Sql代码--判断表是否存在,如果存在则删除declarenum number;beginselect count(1) into num from all_tables where TABLE_N

回答2:

drop table if exists 表名

回答3:

mysql : drop table if exists table