
/*------ ATD 256081 ------*/
DECLARE v_count NUMBER:=0;
BEGIN
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE UPPER(table_name) = 'DADOSNOTANFE' AND UPPER(column_name) = 'VICMSDESON';
EXCEPTION
WHEN NO_DATA_FOUND THEN
begin
EXECUTE IMMEDIATE 'ALTER TABLE DadosNotaNfe ADD VICMSDESON NUMBER(15,2) ';
end;
END;
/

DECLARE v_count NUMBER:=0;
BEGIN
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE UPPER(table_name) = 'DADOSITEMNFE' AND UPPER(column_name) = 'VICMSDESON';
EXCEPTION
WHEN NO_DATA_FOUND THEN
begin
EXECUTE IMMEDIATE 'ALTER TABLE DadosItemNfe ADD VICMSDESON NUMBER(15,2) ';
end;
END;
/
/*------ ATD 265574 ------*/
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'COMPLEMENTOPRODUTO' AND Upper(column_name) = 'FABRICACAOPROPRIA'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE COMPLEMENTOPRODUTO ADD FABRICACAOPROPRIA NUMERIC(1,0) default 0 not null '; 
END;