declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
	'CREATE TABLE DET_ABASTO_BOLETO_HIST (
       DETABASTOBOLETOHIST_ID NUMBER(15) NOT NULL,
       DETABASTOBOLETOENV_ID NUMBER(7) NULL,
       DETABASTOBOLETOREC_ID NUMBER(7) NULL,
       FECMODIF             DATE NULL,
       ACTIVO               NUMBER(1) NULL,
       USUARIO_ID           NUMBER(7) NULL,
       PRIMARY KEY (DETABASTOBOLETOHIST_ID), 
       FOREIGN KEY (USUARIO_ID) REFERENCES USUARIO, 
       FOREIGN KEY (DETABASTOBOLETOREC_ID) REFERENCES DET_ABASTO_BOLETO, 
       FOREIGN KEY (DETABASTOBOLETOENV_ID) REFERENCES DET_ABASTO_BOLETO
	)';
  exception when object_exists then null;
end;
/
declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
  	'CREATE SEQUENCE DET_ABASTO_BOLETO_HIST_SEQ INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE';	
  exception when object_exists then null;
end;
