判断主键是否存在,存在则删除,用SQL怎么写

2025-03-24 19:15:41
推荐回答(1个)
回答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