
/*------ ATD 359455 ------*/
-- Tabela CONTROLEBOLETOEMAIL coluna rCONTAARECEBER
DECLARE v_count NUMBER(1) := 0; 
BEGIN 
SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE Upper(table_name) = 'CONTROLEBOLETOEMAIL' AND Upper(column_name) = 'RCONTAARECEBER'; 
EXCEPTION 
WHEN NO_DATA_FOUND THEN 
EXECUTE IMMEDIATE 'ALTER TABLE CONTROLEBOLETOEMAIL ADD RCONTAARECEBER INT '; 
END;
/
-- Tabela HISTORICOBOLETOEMAIL coluna HISTORICO - Aumentar para 1000
DECLARE v_count NUMBER:=0;
BEGIN
SELECT Count(1) INTO v_count FROM USER_TAB_COLUMNS WHERE UPPER(table_name) = 'HISTORICOBOLETOEMAIL' AND Upper(COLUMN_NAME) = 'HISTORICO' AND DATA_LENGTH < 1000;
IF v_count > 0 THEN
EXECUTE IMMEDIATE 'ALTER TABLE HISTORICOBOLETOEMAIL MODIFY HISTORICO VARCHAR2(1000)';
END IF;
END;
/