Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-08-2019 02:04 AM
I am trying to update node properties of a PostgreSQL database that I have running in a virtual environment. I am building a Jazz knowledge base and would like to use the node ids to query additional properties from the PSQL database using APOC.
I have tried unwinding the ids and using them to run the SQL statements with APOC.
This is the code I have tried thus far:
MATCH (a:Artist)
WHERE a.genre = 'jazz'
WITH COLLECT(a.mbid) AS ids
UNWIND ids AS id
CALL apoc.load.jdbc('myDB',
"select DISTINCT a.gid, ar.name as country FROM artist a INNER JOIN area ar on a.area = ar.id WHERE a.gid = ?", [id]) YIELD row
MATCH (a:Artist) WHERE a.mbid = row.gid SET a.country = row.country
RETURN COUNT(a.country)
I am running into an error saying "ERROR: operator does not exist: uuid = character varying". Is there anyway to use the ids from the Cypher query to update each node individually through individual SQL statements with APOC?
08-08-2019 02:35 PM
Without kowing a thing about your data and how they are data typed on both sides, at first glance, the error: "ERROR: operator does not exist: uuid = character varying" seems to indicate a collation issue (i.e. a common ETL concern when dealing with disparate database systems) when it expects an operator to perform some sort of data type conversion for the VARCHAR data type. Cannot tell if it is from PostgreSQL or Neo4j . Make sure that data types coming and going are fully matched to their respective systems. I would start there first....just a suggestion.
All the sessions of the conference are now available online