declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate
	'CREATE TABLE HIST_PUNTOVENTA(
        "HIST_PUNTOVENTA_ID" NUMBER(15,0) NOT NULL ENABLE,
        "IND_BLOQUEIO" NUMBER (1,0),
        "FEC_BLOQUEIO" DATE,
        "PUNTOVENTA_ID" NUMBER(15,0),
        "ACTIVO" NUMBER(1,0), 
        "FECMODIF" DATE, 
        "USUARIO_ID" NUMBER(7,0),
        CONSTRAINT "PK_HIST_PUNTOVENDA" PRIMARY KEY ("HIST_PUNTOVENTA_ID"),
        CONSTRAINT "FK_HIST_PUNTOVENDA_PUNTOVENDA" FOREIGN KEY("PUNTOVENTA_ID") REFERENCES PUNTO_VENTA("PUNTOVENTA_ID")
    )';
 exception when object_exists then null;
end;
/
declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate 'CREATE SEQUENCE HIST_PUNTOVENTA_SEQ START WITH 1';	
  exception when object_exists then null;
end;
