declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
	'CREATE TABLE SECRETARIA_PUNTOVENTA (
       SECRETARIAPUNTOVENTA_ID INTEGER NOT NULL,
       SECRETARIA_ID        NUMBER(7) NULL,
       PUNTOVENTA_ID        NUMBER(7) NULL,
       ACTIVO               NUMBER(1) NULL,
       USUARIO_ID           NUMBER(7) NULL,
       FECMODIF             DATE NULL,
       PRIMARY KEY (SECRETARIAPUNTOVENTA_ID), 
       FOREIGN KEY (SECRETARIA_ID) REFERENCES SECRETARIA, 
       FOREIGN KEY (PUNTOVENTA_ID) REFERENCES PUNTO_VENTA
	)';
  exception when object_exists then null;
end;
/
declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate 'CREATE SEQUENCE SECRETARIAPUNTOVENTA_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER';	
  exception when object_exists then null;
end;