
/*------ ATD 368355 ------*/
DECLARE v_count NUMBER:=0;

BEGIN

SELECT Count(1) INTO v_count FROM USER_TAB_COLUMNS WHERE UPPER(table_name) = 'BASECALFAT' and UPPER(column_name) = 'CODIGOCEST';

IF v_count = 0 THEN

EXECUTE IMMEDIATE 'ALTER TABLE BASECALFAT ADD CODIGOCEST CHAR(14) DEFAULT '''' NOT NULL';

END IF;

SELECT Count(1) INTO v_count FROM USER_TAB_COLUMNS WHERE UPPER(table_name) = 'ITNFSAICAD' and UPPER(column_name) = 'IDCODREDBASE';

IF v_count = 0 THEN

EXECUTE IMMEDIATE 'ALTER TABLE ITNFSAICAD ADD IDCODREDBASE INT NULL';

END IF;

SELECT Count(1) INTO v_count FROM USER_TAB_COLUMNS WHERE UPPER(table_name) = 'ITNFENTCAD' and UPPER(column_name) = 'IDCODREDBASE';

IF v_count = 0 THEN

EXECUTE IMMEDIATE 'ALTER TABLE ITNFENTCAD ADD IDCODREDBASE INT NULL';

END IF;

END;