(用户权限 GRANT CONNECT, RESOURCE to commonuser)
create or replace procedure UPDATEALLTABLES isbegin
execute immediate 'drop table Tab1';
execute immediate 'create table Tab1 as select * from Tab1@Linkcom where 1=1';
end UPDATEALLTABLES;我想在'drop table Tab1'的之前来个判断表是否存在!改怎么办呢!!?提醒下:我可不是sys权限的哦!
create or replace procedure UPDATEALLTABLES isbegin
execute immediate 'drop table Tab1';
execute immediate 'create table Tab1 as select * from Tab1@Linkcom where 1=1';
end UPDATEALLTABLES;我想在'drop table Tab1'的之前来个判断表是否存在!改怎么办呢!!?提醒下:我可不是sys权限的哦!
iFlag int;
tableName varchar2(20) :='aa';
beginselect count(1) into iFlag from user_tables
where table_name=tableName;if iFlag >1 then
dbms_output.put_line(tablename||':此表已经存在!');
else
dbms_output.put_line(tablename||':此表不存在!');
end if;end;
iFlag int;
tableName varchar2(20) :='aa';
beginselect count(1) into iFlag from user_tables
where table_name=tableName;if iFlag >1 then
dbms_output.put_line(tablename||':此表已经存在!');
else
dbms_output.put_line(tablename||':此表不存在!');
end if;end;