Call apoc.cypher.run warning


I select some rows from my oracle database and I want to update the corresponding relationships in my graph database using apoc.cypher.run beacause the type of my relations returned from my sal query are dynamic.
But I got an error that the variable row is not declared and the properties are not in the database.
or the properties are returned by sql query I put Yield row in the end of my call apoc.load.jdbc

could some one help me please

You are referencing 'row' in the run's cypher string. You need to pass 'row' as a parameter in the apoc.cypher.run parameter map. Replace '{}' with '{row:row}'

You may want to use apoc.create.relationship instead:

thank you for your response I add unwind row as ro and {ro:ro} and it works

1 Like

BTW- you should not need the 'unwind row as ro', as the row returned from the apoc.load.jdbc should be rows of data. Each one of them will be passed to the apoc.cypher.run method when you include the parameter {row:row}.