我在plsqldev5.0中执行了没有任何错误
解决方案 »
- 请教 oracle10g 行列数据转换问题
- 将数据从一个表空间移动到另外一个表空间如何做?
- 同一数据库两个不同用户的数据插入
- oracle中关于shutdown的问题
- 招聘Java工程师、系统工程师和网页设计师(工作地点:北京 )
- 在线求助一源代码:在Oracle Database环境下,用P/LSQL写数据查询中的交叉表SQL语句.
- 关于vb和orcale的连接问题,告急!!!
- [新手请教] 刚开始使用Oracle,请问如何启动服务,建数据库和建表啊?
- 请问:哪里有 orcale developer/2000 的电子版教材下载
- oracle8.1.5 deadlock问题
- SELECT * FOR UPDATE NOWAIT的问题
- 如何取得集合中数值最大的5个数
declare
v_tablename varchar2(30);
v_count pls_integer;
v_sql varchar2(200);
cursor c is
select to_char(table_name) from user_tables
where tablespace_name in('SYSTEM','TOOLS','USERS');
begin
open c;
loop
fetch c into v_tablename;
exit when c%notfound;
execute immediate 'select count(*) from '||v_tablename into v_count;
dbms_output.put_line('count is:'||v_count);
end loop;
exception
when others then
dbms_output.put_line('错误代码:'||sqlcode);
dbms_output.put_line('错误内容:'||sqlerrm);
dbms_output.put_line('错误表:'||v_tablename);
close c;
end;count is:0
count is:2554
count is:0
count is:1
count is:759
错误代码:-911
错误内容:ORA-00911: 无效字符
错误表:_default_auditing_options_
if substr(v_tablename,1,1)='_' or substr(v_tablename,1,1)='$' or substr (v_tablename,1,1)='#' then
v_tablename:='"'||v_tablename||'"';
end if;
2 v_tabname varchar2(30);
3 v_count pls_integer;
4 cursor c_table is
5 select table_name from user_tables
6 where tablespace_name in('SYSTEM','TOOLS','USERS');
7 begin
8 open c_table;
9 loop
10 fetch c_table into v_tabname;
11 exit when c_table%notfound;
12 execute immediate 'select count(*) from ' || v_tabname into
13 v_count;
14 if v_count > 0 then
15 execute immediate 'create table ' || v_tabname || 'bk as
16 select * from ' || v_tabname;
17 execute immediate 'drop table ' || v_tabname;
18 execute immediate 'alter table ' || v_tabname || 'bk rename
19 to ' || v_tabname;
20 dbms_output.put_line('success move table: ' || v_tabname);
21 else
22 execute immediate 'drop table ' || v_tabname;
23 dbms_output.put_line('success delete table: ' || v_tabname);
24 end if;
25 end loop;
26 close c_table;
27 end;
28 /
declare
*
ERROR 位于第 1 行:
ORA-00942: 表或视图不存在
ORA-06512: 在line 17
已用时间: 00: 00: 01.01
SYS>>show error;
没有错误。
SYS>>