Hi,
I have a very large data set I want to into neo4j from a database. However the SQL statement needed to select the data requires the use of single quotes which is causing the load to fail.
I know i could just create a view in the database which includes all my logic, then simply select * from myView
. But I wonder if there is an alternative way.
CALL apoc.periodic.iterate("
CALL apoc.load.jdbc('jdbc:oracle:thin:@database:port/service_name',
'select *
from MyTable
where id <> ' ' //the quotes here are causing the error
',
[],
{credentials:{user: 'user', password: 'pasword'}}) YIELD row RETURN row
"
,"
CREATE (:entity {id: row.id}
)
", {batchSize:10000, iterateList:true, parallel:true});
error
Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure
apoc.periodic.iterate: Caused by: org.neo4j.cypher.internal.v3_5.util.SyntaxException: Invalid input ''': expected whitespace, comment, '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', '~', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR, ',' or ')' (line 5, column 16 (offset: 134))
I have tried escaping the quotes but this didn't work either
CALL apoc.periodic.iterate("
CALL apoc.load.jdbc('jdbc:oracle:thin:@database:port/service_name',
'select *
from MyTable
where id <> \' \' //the quotes here are causing the error
',
[],
{credentials:{user: 'user', password: 'pasword'}}) YIELD row RETURN row
"
,"
CREATE (:entity {id: row.id}
)
", {batchSize:10000, iterateList:true, parallel:true});