declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate 'CREATE TABLE TARIFA_GRUPO_CONTRATO (
					    "TARIFAGRUPOCONTRATO_ID" NUMBER(7,0) PRIMARY KEY,
					    "GRUPOCONTRATO_ID" NUMBER(7,0),
					    "ORIGEN_ID" NUMBER(7,0),
					    "DESTINO_ID" NUMBER(7,0),
					    "CLASESERVICIO_ID" NUMBER(7,0),
					    "TARIFA" NUMBER(10, 2),
					    "USUARIO_ID" NUMBER(7,0),
						"INDCOBERTURA" NUMBER(1,0),
					    "ACTIVO" NUMBER(1,0),
					    "FECMODIF" DATE,					    
					    CONSTRAINT "fk_grupo_contrato" FOREIGN KEY ("GRUPOCONTRATO_ID") REFERENCES "GRUPO_CONTRATO"("GRUPOCONTRATO_ID"),
					    CONSTRAINT "fk_parada_origen" FOREIGN KEY ("ORIGEN_ID") REFERENCES "PARADA"("PARADA_ID"),
					    CONSTRAINT "fk_parada_destino" FOREIGN KEY ("DESTINO_ID") REFERENCES "PARADA"("PARADA_ID"),
					    CONSTRAINT "fk_clase_servicio" FOREIGN KEY ("CLASESERVICIO_ID") REFERENCES "CLASE_SERVICIO"("CLASESERVICIO_ID")
					)';
  exception when object_exists then null;
end;
/
declare
    object_exists exception;
    pragma exception_init (object_exists , -00955);
begin
  execute immediate 'CREATE SEQUENCE "TARIFA_GRUPO_CONTRATO_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE';
  exception when object_exists then null;
end;