Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-17-2022 10:19 AM
Hello, how are you?
Guys, I am new on neo4j, so I need a lot of help. At this momment I am trying to create a relationship between two nodes and I am receiving a messa error. To the first match I am basing on a existin relationship. I think that this is my mistake. Bellow is my code:
MATCH (po:PessoaOrigem {COD_CAMPO_PK_LEGADO_01: '1'})-[GOLDEN]->(pu:PessoaUnica) return pu
MATCH (c:ContratoOrigem {COD_CAMPO_PK_LEGADO_01: '110'}) return c
MERGE (pu)-[:POSSUI_CONTRATO]->(c);
Now the error message :
RETURN can only be used at the end of the query (line 1, column 82 (offset: 81))
"MATCH (po:PessoaOrigem {COD_CAMPO_PK_LEGADO_01: '1'})-[GOLDEN]->(pu:PessoaUnica) return pu"
Regards,
Igor Martins
05-17-2022 10:30 AM
as the error states RETURN can only be used at the end of the query
. do you want to change your cypher to
MATCH (po:PessoaOrigem {COD_CAMPO_PK_LEGADO_01: '1'})-[GOLDEN]->(pu:PessoaUnica) return pu
MATCH (c:ContratoOrigem {COD_CAMPO_PK_LEGADO_01: '110'})
MERGE (pu)-[:POSSUI_CONTRATO]->(c)
return c;
05-17-2022 10:34 AM
Thank you my friend.. It works fine!
Regards, Igor Martins
All the sessions of the conference are now available online