v integer;
begin
select count(*) into v from tabs where table_name='your_table_name';
if v>0 then
dbms_output.putline('表存在!');
end if;
end;
begin
select count(*) into v from tabs where table_name='your_table_name';
if v>0 then
dbms_output.putline('表存在!');
end if;
end;
解决方案 »
- 查询的问题
- 为什么在windowsxp下用jdbc访问不了windows 2003里orale9i数据库
- 求一sql分类列表语句.一级区域,二级区域.
- oracle去用户密码问题?
- 求高手指点个查询统计语句的写法,求高手帮忙
- 求用一条语句实现对一张表的Insert和Delete处理
- blob列的全文检索
- 求教:一个SQL语句问题
- Oracle数据库已经建立,中文无法显示,有没有什么办法直接改字符集体?·!!!
- 创建Oracle procedure 输入参数后 修改多种表数据,为什么创建procedure会报错,一楼贴出代码,请帮忙看下
- 请指导:oracle中如何执行日期时间相加操作?
- 怎样在建表时估算它所占的空间大小?
where object_name='T_PX_HZ_TEMP'
where object_type='TABLE' and object_name='MyTB_Name'
connect internal/oracle;(本地服务器)
set serveroutput on;
declare
ls_owner varchar(20);
begin
select owner into ls_owner
from dba_tables
where table_name = 'EMPLOYE_TABLE';-- 一定要大写
if owner = 'PUBLIC' then
dbms_output.putline('表存在!');
else
dbms_output.putline('表存在!');
end if ;
end;
/
假如你的表为 public.employe_table
connect internal/oracle;(本地服务器)
set serveroutput on;
declare
ls_owner varchar(20);
begin
select owner into ls_owner
from dba_tables
where table_name = 'EMPLOYE_TABLE';-- 一定要大写
if owner = 'PUBLIC' then
dbms_output.putline('表存在!');
else
dbms_output.putline('表不存在!');
end if ;
end;
/
if n=1 then
y
else
n
end if;
了解一下以下视图的内容,就会有收获。
user_objects dba_objects
user_tables dba_tables
等