
/*------ ATD 322819 ------*/
DECLARE v_count NUMBER(1) := 0;
BEGIN
  SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE upper(table_name) = 'ITNFENTCOMPLEMENTO' AND upper(column_name) = 'ALIQPISIMPORTACAO';
  EXCEPTION
   WHEN NO_DATA_FOUND THEN
    EXECUTE IMMEDIATE 'alter table ItnfentComplemento add AliqPisImportacao Numeric(4,2) default 0 NOT NULL';
END;
/
DECLARE v_count NUMBER(1) := 0;
BEGIN
  SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE upper(table_name) = 'ITNFENTCOMPLEMENTO' AND upper(column_name) = 'VALPISIMPORTACAO';
  EXCEPTION
   WHEN NO_DATA_FOUND THEN
    EXECUTE IMMEDIATE 'alter table ItnfentComplemento add ValPisImportacao Numeric(15,2) default 0 NOT NULL';
END;
/
DECLARE v_count NUMBER(1) := 0;
BEGIN
  SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE upper(table_name) = 'CLAFISCCAD' AND upper(column_name) = 'ALIQPISIMPORTACAO';
  EXCEPTION
   WHEN NO_DATA_FOUND THEN
    EXECUTE IMMEDIATE 'alter table ClafiscCad add AliqPisImportacao Numeric(4,2) default 0 NOT NULL';
END;
/
DECLARE v_count NUMBER(1) := 0;
BEGIN
  SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE upper(table_name) = 'CLAFISCCAD' AND upper(column_name) = 'ALIQPISIMPORTACAO_LP';
  EXCEPTION
   WHEN NO_DATA_FOUND THEN
    EXECUTE IMMEDIATE 'alter table ClafiscCad add AliqPisImportacao_Lp Numeric(4,2) default 0 NOT NULL';
END;
/