declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
  	'CREATE SEQUENCE  TAXPOLEXCECAO_PK  MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 101 CACHE 20 NOORDER  NOCYCLE';	
  exception when object_exists then null;
end;
/
declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
  'CREATE TABLE TAXPOL_EXCECAO 
  (TAXPOLEXCECAO_ID NUMBER(7,0) NOT NULL ENABLE, 
	PUNTOVENTA_ID NUMBER(7,0),  
	LOCALIDADE_ID NUMBER(7,0),  
	CATEGORIA NUMBER(7,0),
	RUTA_ID NUMBER(7,0), 
	ORGAOCONCEDENTE_ID NUMBER(7,0), 
	EMPRESA_ID NUMBER(7,0), 
	DESCTAXAEXCECAO VARCHAR2(200),
	FECMODIF DATE,
	ACTIVO NUMBER(1,0),
	CONSTRAINT TAXPOLEXCECAO_PK PRIMARY KEY (TAXPOLEXCECAO_ID) ENABLE,  
	FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA (EMPRESA_ID) ON DELETE SET NULL ENABLE,
	FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA (PUNTOVENTA_ID) ON DELETE SET NULL  ENABLE,
	FOREIGN KEY (LOCALIDADE_ID) REFERENCES PARADA (PARADA_ID) ON DELETE SET NULL ENABLE)';
	exception when object_exists then null;
end;