
/*------ ATD 197657 ------*/
--- ORACLE
DECLARE v_count NUMBER(1):=0;
BEGIN
  SELECT count(*) INTO v_count FROM USER_TAB_COLUMNS WHERE table_name = 'COMPLEMENTONFSAIDA' AND column_name = 'FLAGRENTABI';
    IF v_count=0 then
        EXECUTE IMMEDIATE 'ALTER TABLE COMPLEMENTONFSAIDA ADD FLAGRENTABI NUMBER(1) DEFAULT 0';
    END IF;
END;

DECLARE v_count NUMBER(1):=0;
BEGIN
  SELECT count(*) INTO v_count FROM USER_TAB_COLUMNS WHERE table_name = 'COMPLEMENTONFENTRA' AND column_name = 'FLAGRENTABI';
    IF v_count=0 then
        EXECUTE IMMEDIATE 'ALTER TABLE COMPLEMENTONFENTRA ADD FLAGRENTABI NUMBER(1) DEFAULT 0';
    END IF;
END;

COMMIT