Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-29-2019 09:45 AM
Hi Team,
I'm running the code below to try and load a new relationship from data in an external server. My Select_In parameter contains single quotes, hence why i'm not passing this directly into the query.
The parameter creates with no issues but when i try to run the apoc periodic iterate section i get the following error:-
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure
apoc.periodic.iterate
: Caused by: org.neo4j.cypher.ParameterNotFoundException: Expected parameter(s): Select_In
I'm a Neo4J rookie so any pointers as to how to pass this parameter information in successfully would be appreciated.
:param Select_In => "select variables
from (
select variables_in
from table_a a
join table_b b
on a.id=b.id
where conditions)"
CALL apoc.periodic.iterate("
CALL apoc.load.jdbc('jdbc:oracle:thin:@server',
$Select_In,
[],
{credentials:{user: 'username', password: 'password'}}) YIELD row RETURN row
","
MATCH (co:Comp {id: row.ID}), (co1:Comp {id: row.ID2}
CREATE (co)-[:Relationship]->(co1)
", {batchSize:10000, iterateList:true, parallel:false})
Cheers,
Sam
Solved! Go to Solution.
10-30-2019 03:54 AM
You need to explicitly pass through the parameters to the inner statement using params
in the map (3rd argument, last line):
:param Select_In => "select variables
from (
select variables_in
from table_a a
join table_b b
on a.id=b.id
where conditions)"
CALL apoc.periodic.iterate("
CALL apoc.load.jdbc('jdbc:oracle:thin:@server',
$Select_In,
[],
{credentials:{user: 'username', password: 'password'}}) YIELD row RETURN row
","
MATCH (co:Comp {id: row.ID}), (co1:Comp {id: row.ID2}
CREATE (co)-[:Relationship]->(co1)
", {batchSize:10000, iterateList:true, parallel:false,
params: {Select_In: $Select_In}
})
10-30-2019 03:54 AM
You need to explicitly pass through the parameters to the inner statement using params
in the map (3rd argument, last line):
:param Select_In => "select variables
from (
select variables_in
from table_a a
join table_b b
on a.id=b.id
where conditions)"
CALL apoc.periodic.iterate("
CALL apoc.load.jdbc('jdbc:oracle:thin:@server',
$Select_In,
[],
{credentials:{user: 'username', password: 'password'}}) YIELD row RETURN row
","
MATCH (co:Comp {id: row.ID}), (co1:Comp {id: row.ID2}
CREATE (co)-[:Relationship]->(co1)
", {batchSize:10000, iterateList:true, parallel:false,
params: {Select_In: $Select_In}
})
10-30-2019 05:14 AM
Thanks Stefan, that works. I thought i'd tried combinations of that syntax but obviously not!
04-20-2022 10:45 AM
Hi, I run into problem when setting parameters. It said 'unexpected "\n". What might be the issue? Thank you.
All the sessions of the conference are now available online