CALL apoc.periodic.iterate( " cypher runtime=slotted CALL apoc.load.jdbc($hostname, \" SELECT \\\"id\\\", \\\"consumerTag\\\", \\\"serviceNameCustomer\\\", \\\"productNameOffering\\\", \\\"name\\\", \\\"room\\\", \\\"startDate\\\", \\\"endDate\\\", \\\"customerLabel\\\", \\\"phone\\\", \\\"assetId\\\", \\\"state\\\", \\\"type\\\", \\\"billProfileId\\\", \\\"contractId\\\", \\\"productId\\\", \\\"subProductId\\\", \\\"deleted\\\", \\\"respTimePrio4Nonoff\\\", \\\"respTimePrio4Office\\\", \\\"repTimePrio3Office\\\", \\\"respTimePrio1Nonoff\\\", \\\"respTimePrio1Office\\\", \\\"compbaseValue\\\", \\\"repTimePrio2Nonoff\\\", \\\"repTimePrio4Nonoff\\\", \\\"repTimePrio2Office\\\", \\\"respTimePrio2Nonoff\\\", \\\"respTimeOnsPrio1Office\\\", \\\"respTimePrio3Office\\\", \\\"repTimePrio1Nonoff\\\", \\\"repTimePrio3Nonoff\\\", \\\"respTimePrio3Nonoff\\\", \\\"repTimePrio4Office\\\", \\\"respTimePrio2Office\\\", \\\"repTimePrio1Office\\\", \\\"agoProductId\\\", \\\"cldBusinessGroupId\\\", \\\"ippSpId\\\", \\\"mrkEntitlementId\\\", \\\"samEquipmentId\\\", \\\"symContractId\\\", \\\"tisKsapId\\\", \\\"oitInstanceId\\\" FROM cms_data.hv_service WHERE timestamp \" + $date + \" >= \\\"fromDate\\\" AND timestamp \" + $date + \" < \\\"toDate\\\" \", [], {credentials:{user:$username, password: $password}}) YIELD row ", " MERGE (s:Service{id: toInteger(row.id)}) ON CREATE SET s.consumerTag = toInteger(row.consumerTag), s.serviceNameCustomer = row.serviceNameCustomer, s.productNameOffering = row.productNameOffering, s.name = row.name, s.room = row.room, s.startDate = date(row.startDate), s.northName = row.northName, s.southName = row.southName, s.endDate = date(row.endDate), s.customerLabel = row.customerLabel, s.phone = row.phone, s.assetId = row.assetId, s.state = row.state, s.type = row.type, s.billProfileId = toInteger(row.billProfileId), s.contractId = toInteger(row.contractId), s.productId = toInteger(row.productId), s.subProductId = toInteger(row.subProductId), s.deleted = toInteger(row.deleted), s.incidentInterventionTimePrio4Nonoff = row.respTimePrio4Nonoff, s.incidentInterventionTimePrio4 = row.respTimePrio4Office, s.incidentTimeToResolvePrio3 = row.repTimePrio3Office, s.incidentInterventionTimePrio1Nonoff = row.respTimePrio1Nonoff, s.incidentInterventionTimePrio1 = row.respTimePrio1Office, s.compbaseValue = toInteger(row.compbaseValue), s.incidentTimeToResolvePrio2Nonoff = row.repTimePrio2Nonoff, s.incidentTimeToResolvePrio4Nonoff = row.repTimePrio4Nonoff, s.incidentTimeToResolvePrio2 = row.repTimePrio2Office, s.incidentInterventionTimePrio2Nonoff = row.respTimePrio2Nonoff, s.respTimeOnsPrio1Office = row.respTimeOnsPrio1Office, s.incidentInterventionTimePrio3 = row.respTimePrio3Office, s.incidentTimeToResolvePrio1Nonoff = row.repTimePrio1Nonoff, s.incidentTimeToResolvePrio3Nonoff = row.repTimePrio3Nonoff, s.incidentInterventionTimePrio3Nonoff = row.respTimePrio3Nonoff, s.incidentTimeToResolvePrio4 = row.repTimePrio4Office, s.incidentInterventionTimePrio2 = row.respTimePrio2Office, s.incidentTimeToResolvePrio1 = row.repTimePrio1Office ON MATCH SET s.consumerTag = toInteger(row.consumerTag), s.serviceNameCustomer = row.serviceNameCustomer, s.productNameOffering = row.productNameOffering, s.name = row.name, s.room = row.room, s.startDate = date(row.startDate), s.northName = row.northName, s.southName = row.southName, s.endDate = date(row.endDate), s.customerLabel = row.customerLabel, s.phone = row.phone, s.assetId = row.assetId, s.state = row.state, s.type = row.type, s.billProfileId = toInteger(row.billProfileId), s.contractId = toInteger(row.contractId), s.productId = toInteger(row.productId), s.subProductId = toInteger(row.subProductId), s.deleted = toInteger(row.deleted), s.incidentInterventionTimePrio4Nonoff = row.respTimePrio4Nonoff, s.incidentInterventionTimePrio4 = row.respTimePrio4Office, s.incidentTimeToResolvePrio3 = row.repTimePrio3Office, s.incidentInterventionTimePrio1Nonoff = row.respTimePrio1Nonoff, s.incidentInterventionTimePrio1 = row.respTimePrio1Office, s.compbaseValue = toInteger(row.compbaseValue), s.incidentTimeToResolvePrio2Nonoff = row.repTimePrio2Nonoff, s.incidentTimeToResolvePrio4Nonoff = row.repTimePrio4Nonoff, s.incidentTimeToResolvePrio2 = row.repTimePrio2Office, s.incidentInterventionTimePrio2Nonoff = row.respTimePrio2Nonoff, s.respTimeOnsPrio1Office = row.respTimeOnsPrio1Office, s.incidentInterventionTimePrio3 = row.respTimePrio3Office, s.incidentTimeToResolvePrio1Nonoff = row.repTimePrio1Nonoff, s.incidentTimeToResolvePrio3Nonoff = row.repTimePrio3Nonoff, s.incidentInterventionTimePrio3Nonoff = row.respTimePrio3Nonoff, s.incidentTimeToResolvePrio4 = row.repTimePrio4Office, s.incidentInterventionTimePrio2 = row.respTimePrio2Office, s.incidentTimeToResolvePrio1 = row.repTimePrio1Office WITH s, row CALL { WITH row WITH row WHERE row.agoProductId IS NOT NULL MERGE (e:ExternalID:AGO{value: toInteger(row.agoProductId)}) ON CREATE SET e.type = 'Product ID', e.refId = toInteger(row.id) ON MATCH SET e.refId = toInteger(row.id) } CALL{ WITH row WITH row WHERE row.cldBusinessGroupId IS NOT NULL MERGE (e1:ExternalID:CLD{value: row.cldBusinessGroupId}) ON CREATE SET e1.type = 'Business Group ID', e1.refId = toInteger(row.id) ON MATCH SET e1.refId = toInteger(row.id) } CALL{ WITH row WITH row WHERE row.ippSpId IS NOT NULL MERGE (e2:ExternalID:IPP{value: toInteger(row.ippSpId)}) ON CREATE SET e2.type = 'Sp ID', e2.refId = toInteger(row.id) ON MATCH SET e2.refId = toInteger(row.id) } CALL{ WITH row WITH row WHERE row.mrkEntitlementId IS NOT NULL MERGE (e3:ExternalID:MRK{value: row.mrkEntitlementId}) ON CREATE SET e3.type = 'Entitlement ID', e3.refId = toInteger(row.id) ON MATCH SET e3.refId = toInteger(row.id) } CALL{ WITH row WITH row WHERE row.samEquipmentId IS NOT NULL MERGE (e4:ExternalID:SAM{value: toInteger(row.samEquipmentId)}) ON CREATE SET e4.type = 'Equipment ID', e4.refId = toInteger(row.id) ON MATCH SET e4.refId = toInteger(row.id) } CALL{ WITH row WITH row WHERE row.symContractId IS NOT NULL MERGE (e5:ExternalID:SYM{value: row.symContractId}) ON CREATE SET e5.type = 'Contract ID', e5.refId = toInteger(row.id) ON MATCH SET e5.refId = toInteger(row.id) } CALL{ WITH row WITH row WHERE row.tisKsapId IS NOT NULL MERGE (e6:ExternalID:TIS{value: toInteger(row.tisKsapId)}) ON CREATE SET e6.type = 'Ksap ID', e6.refId = toInteger(row.id) ON MATCH SET e6.refId = toInteger(row.id) } CALL{ WITH row WITH row WHERE row.oitInstanceId IS NOT NULL MERGE (e7:ExternalID:OIT{value: row.oitInstanceId}) ON CREATE SET e7.type = 'Instance ID', e7.refId = toInteger(row.id) ON MATCH SET e7.refId = toInteger(row.id) } RETURN true ", {batchSize:10000, parallel:false, params: {hostname: hostname, username: username, password: password, date: date}} )