declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
    execute immediate 'CREATE TABLE INTEGRACAO_TOTVS (
						INTEGRACAOTOTVS_ID NUMBER(7,0) NOT NULL ENABLE,
						DESC_INTEGRACAO VARCHAR2(20 BYTE), 
						FECINI DATE,
						FECFIN DATE,
						PUNTOVENTA_ID NUMBER(7,0),
						EMPRESA_ID NUMBER(7,0),
						CORRIDA_ID NUMBER(7,0),
						ESQUEMACORRIDA_ID NUMBER(7,0),
						ACTIVO NUMBER(1,0),
						FECMODIF DATE,
						QTDEREGISTROSATUALIZADOS NUMBER(7,0),
						USUARIO_ID NUMBER(7,0),
						CONSTRAINT "PK_INTEGRACAOTOTVS" PRIMARY KEY ("INTEGRACAOTOTVS_ID"),
						CONSTRAINT "FK_INTEGRACAOTOTVS_USUARIO" FOREIGN KEY ("USUARIO_ID") REFERENCES USUARIO("USUARIO_ID"),
						CONSTRAINT "FK_INTEGRACAOTOTVS_PTO_VENTA" 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 "INTEGRACAOTOTVS_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
    exception when object_exists then null;
end;