要在oracle上创建一个表,想先判断一下是否存在,如果存在则删除!在C#程序中实现 if exists (select 1 from all_tables where table_name='TMP_SQLLDR_TABLE') drop table tmp_sqlldr_Table这么写行吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那样也可以,也可以这样;if exists(select 1 from user_tables where upper(table_name)='TMP_SQLLDR_TABLE')drop table TMP_SQLLDR_TABLE ;end if ; 还有一种方法是直接drop table,然后看出错代码,如果是ora-942,表示表不存在,当正常处理,其他错误则当异常处理。 你这样写:if exists(select 1 from user_tables where upper(table_name)='TMP_SQLLDR_TABLE') execute immediate drop table TMP_SQLLDR_TABLE ; end if ; 你这样写: if exists(select 1 from user_tables where upper(table_name)='TMP_SQLLDR_TABLE') execute immediate 'drop table TMP_SQLLDR_TABLE'; end if ; 哎,还是报错,无效的SQL语句 if exists (select 1 from all_tables where table_name='TMP_SQLLDR_TABLE') drop table tmp_sqlldr_Table 一群拍脑袋说话的家伙,注意这里是oracle语句,不是SqlServer语句 如何 判断 ‘234’与 ‘432’是一样的只是位置不一样 在查询中怎么做到只要查到结果马上返回? 为什么返回的是20条记录,而不是15条 回滚的问题 object browser如何导入.csv数据 如何查询到磁盘读写最大的session? 关于toad的问题 帮我看一下这个过程错在哪里? Access怎样转化成Oracle 往oracle中插數據時請教怎麼改寫; to_date('2002/07/26 07:40','YYYY/MM/DD hh:nn:ss') 关于产品分类的数据库设计 请教这样的SQL怎么写
if exists(select 1 from user_tables where upper(table_name)='TMP_SQLLDR_TABLE')
drop table TMP_SQLLDR_TABLE ;
end if ;
if exists(select 1 from user_tables where upper(table_name)='TMP_SQLLDR_TABLE')
execute immediate drop table TMP_SQLLDR_TABLE ;
end if ;
if exists(select 1 from user_tables where upper(table_name)='TMP_SQLLDR_TABLE')
execute immediate 'drop table TMP_SQLLDR_TABLE';
end if ;
drop table tmp_sqlldr_Table