declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
	'CREATE TABLE CTRL_SERIE_BPE (
       CTRLSERIEBPE_ID      NUMBER(7) NOT NULL,
       NUMSERIE             VARCHAR(3) NULL,
       EMPRESA_ID           NUMBER(7) NULL,
       ESTADO_ID            NUMBER(7) NULL,
       FECMODIF             DATE NULL,
       USUARIO_ID           NUMBER(7) NULL,
       ACTIVO               NUMBER(1) NULL,
       PRIMARY KEY (CTRLSERIEBPE_ID), 
       FOREIGN KEY (EMPRESA_ID) REFERENCES EMPRESA, 
       FOREIGN KEY (ESTADO_ID) REFERENCES ESTADO
	)';
	  
  execute immediate 
	'CREATE SEQUENCE "CTRL_SERIE_BPE_SEQ" MINVALUE 1 MAXVALUE 9999999 INCREMENT BY 1 START WITH 1 ORDER NOCACHE NOCYCLE';	
  exception when object_exists then null;
end;
