The views and opinions expressed all for my own,only for study and test, not reflect the views of Any Company and its affiliates.
分类:
2008-12-11 18:54:45
declare
sql1 varchar2(2000);
begin
for v in (select a.table_name,a.comments from dba_tab_comments a where a.owner='GAU01E')
loop
sql1:='comment on table '||v.table_name||' is '||''''||v.comments||'''';
begin
execute immediate sql1;
exception
when others then
null;
end;
end loop;
for c in(select table_name,column_name,comments from dba_col_comments b where b.owner='GAU01E')
loop
sql1 := 'comment on column '||c.table_name||'.'||c.column_name||' is '''||c.comments||'''';
begin
execute immediate sql1;
exception
when others then
null;
end;
end loop;
end;