本文主要是介绍Oracle中复制注释到新表中去,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
declare
v_comment varchar2(100);
v_stmt varchar2(4000);
v_orig_table varchar2(100) :='ORIGINAL_TABLE';
v_new_table varchar2(100) :='MYTABLE';
begin
for c in (select column_name
from user_tab_columns c
where table_name=v_orig_table
and exists(select 1
from user_tab_columns
where table_name=v_new_table
and column_name=c.column_name)) loop
select comments
into v_comment
from user_col_comments
where table_name= v_orig_table
and column_name=c.column_name;
v_stmt:='comment on column '||v_new_table||'.'||c.column_name||' IS '''||v_comment||'''';
execute immediate v_stmt;
end loop;
end;
这篇关于Oracle中复制注释到新表中去的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!