Output '\t' in dbms_output package!
Use Oracle character function to replace the '\t' and other special characters!
declare
t1 INTEGER;
t2 INTEGER;
stmt VARCHAR2(2048);
begin
for t in (select tname from tab) loop
stmt := 'select count(*) from ' || t.tname;
execute immediate stmt into t1;
stmt := 'select count(*) from SYSTEM.' || t.tname;
execute immediate stmt into t2;
if t1 != t2 then
stmt := chr(9) || 'Different! ';
else
stmt := chr(9) || ' ';
end if;
dbms_output.put_line(RPAD(t.tname, 34, ' ')
|| chr(9) || to_char(t1) || chr(9) || to_char(t2)
|| stmt);
end loop;
end;
|
阅读(2768) | 评论(0) | 转发(0) |