ORCALE 增加两列字段
Posted 萌橙
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORCALE 增加两列字段相关的知识,希望对你有一定的参考价值。
declare v_cnt number;
V_SQL VARCHAR2 (500) := ‘‘;
begin
select count(*) into v_cnt from dual where exists(SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NAME = UPPER(‘TB_FDN_DEVICEACCOUNT‘) AND COLUMN_NAME = ‘NSBFL‘);
if v_cnt = 0 then
V_SQL := ‘ALTER TABLE TB_FDN_DEVICEACCOUNT ADD NSBFL NVARCHAR2(50)‘;
EXECUTE IMMEDIATE V_SQL;
V_SQL := ‘comment on column TB_FDN_DEVICEACCOUNT.NSBFL is ‘‘原设备分类‘‘‘;
EXECUTE IMMEDIATE V_SQL;
end if;
select count(*) into v_cnt from dual where exists(SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NAME = UPPER(‘TB_FDN_DEVICEACCOUNT‘) AND COLUMN_NAME = ‘NSBLX‘);
if v_cnt = 0 then
V_SQL := ‘ALTER TABLE TB_FDN_DEVICEACCOUNT ADD NSBLX NVARCHAR2(50)‘;
EXECUTE IMMEDIATE V_SQL;
V_SQL := ‘comment on column TB_FDN_DEVICEACCOUNT.NSBLX is ‘‘原设备类型‘‘‘;
EXECUTE IMMEDIATE V_SQL;
end if;
end;
以上是关于ORCALE 增加两列字段的主要内容,如果未能解决你的问题,请参考以下文章