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

BEGIN

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

IF v_count = 0 THEN

EXECUTE IMMEDIATE 'alter table PEDICLICOMPLEMENTO add DESCONTONACIONAIS number(17,5) default 0 NULL';

END IF;

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

IF v_count = 0 THEN

EXECUTE IMMEDIATE 'alter table PEDICLICOMPLEMENTO add PERCDESCONTONACIONAIS number(6,2) default 0 NULL';

END IF;

END;