标签:count ice table comm alt bsp exe column arc
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;
标签:count ice table comm alt bsp exe column arc
原文地址:http://www.cnblogs.com/daimaxuejia/p/6780125.html