
/*------ ATD 411808 ------*/
-- Adicionando coluna CUSTOBASEICMS na tabela ITNFSAICOMPLEMENTO
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'ITNFSAICOMPLEMENTO' AND Upper(column_name) = 'CUSTOBASEICMS'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE ITNFSAICOMPLEMENTO ADD CUSTOBASEICMS NUMERIC(15,5) default 0 null '; 
END;

-- Adicionando coluna CUSTOBASEICMS na tabela ITEMCLICOMPLEMENTO
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'ITEMCLICOMPLEMENTO' AND Upper(column_name) = 'CUSTOBASEICMS'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE ITEMCLICOMPLEMENTO ADD CUSTOBASEICMS NUMERIC(15,5) default 0 not null '; 
END;