# Query all code at once which include periodic (implicitly)

**URL:** <https://community.neo4j.com/t/query-all-code-at-once-which-include-periodic-implicitly/59118>\
**Category:** Conferences, Meetups, & Events\
**Tags:** migrated\
**Created:** [November 30, 2022, 6:29am UTC](https://community.neo4j.com/t/query-all-code-at-once-which-include-periodic-implicitly/59118 "2022-11-30T06:29:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Lian](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@Peter\_Lian](https://community.neo4j.com/u/Peter_Lian)\
**Post date:** [November 30, 2022, 6:29am UTC](https://community.neo4j.com/t/query-all-code-at-once-which-include-periodic-implicitly/59118/1 "2022-11-30T06:29:31Z")

</div>

The following is my query

##################################

CALL apoc.periodic.iterate('

CALL apoc.load.json("1114-Sysmon-02to01.json") YIELD value return value','

UNWIND value.Event AS col\_event

WITH col\_event

WHERE col\_event.System.EventID = 1

CREATE(process:Process{eventid: coalesce(col\_event.System.EventID, "No ID"),

euid:col\_event.System.EventRecordID,

pid:col\_event.EventData.ProcessGuid})',

{batchSize:10000, iterateList:true, parallel:true})

CALL{

MATCH(e:Process)

MATCH(f:Process)

WHERE e.euid = f.euid AND f.parentID IS NOT NULL

SET e.pid2 = e.pid,

f.pid2 = f.parentID

}

CALL apoc.periodic.iterate("MATCH(e:Process), (f:Process) WHERE e.euid = f.euid AND f.parentID IS NOT NULL AND e.computer IS NOT NULL RETURN e,f",

"CREATE(f)-[r:create\_process\_to]-\>(e)",

{batchSize:10000, parallel: true})

##################################

I try query above in once but the following error shows :

Procedure call inside a query does not support naming results implicitly (name explicitly using `YIELD` instead)

Although I can divided above into three pieces to run, but in order to check the performance and efficiency, it must be queried in the same time.

Question : Is there any method to query above code in the same time (don't need to split into pieces)

Thanks.

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [November 30, 2022, 9:12am UTC](https://community.neo4j.com/t/query-all-code-at-once-which-include-periodic-implicitly/59118/2 "2022-11-30T09:12:50Z")

</div>

apoc.periodic.iterate returns values. Try returning at least one variable to the first method call. Add to the second too, if just the first does not resolve your error. ‘Yield total’ should be sufficient.

[https://neo4j.com/labs/apoc/4.1/overview/apoc.periodic/apoc.periodic.iterate/#\_output\_parameters](https://neo4j.com/labs/apoc/4.1/overview/apoc.periodic/apoc.periodic.iterate/#_output_parameters)

---

<div class="post-metadata">

**Author:** ![Peter\_Lian](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@Peter\_Lian](https://community.neo4j.com/u/Peter_Lian)\
**Post date:** [November 30, 2022, 11:09am UTC](https://community.neo4j.com/t/query-all-code-at-once-which-include-periodic-implicitly/59118/3 "2022-11-30T11:09:38Z")

</div>

It's done. Appreciate about it !
