
/*------ ATD 170962 ------*/
DECLARE v_count NUMBER(1) := 0;
BEGIN
  SELECT 1 INTO v_count FROM USER_TAB_COLUMNS WHERE upper(table_name) = 'SUBSTENTRADA' AND upper(column_name) = 'NAOABATERCREDITOICMS';
  EXCEPTION
   WHEN NO_DATA_FOUND THEN
     EXECUTE IMMEDIATE 'alter table SUBSTENTRADA add NAOABATERCREDITOICMS Numeric(1) not null default 0';
END;