
/*------ ATD 365890 ------*/
-- ORACLE
DECLARE v_count NUMBER:=0;
BEGIN
SELECT Count(1) INTO v_count FROM USER_TAB_COLUMNS WHERE UPPER(table_name) = 'ITNFSAICOMPLEMENTO' and UPPER(column_name) = 'ICMSIPI';
IF v_count = 0 THEN
 EXECUTE IMMEDIATE 'ALTER TABLE ITNFSAICOMPLEMENTO ADD ICMSIPI CHAR(1) DEFAULT '' '' NULL';
END IF;
END;