
/*------ ATD 285564 ------*/
-- Adicionando coluna BANDEIRA na tabela TRANSACAOCARTAO
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'TRANSACAOCARTAO' AND Upper(column_name) = 'BANDEIRA'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE TRANSACAOCARTAO ADD BANDEIRA CHAR(5) default ' ' not null '; 
END;

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