cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Error on a subquery CALL

Neo4j Community edition 4.3.3

I have the following minimal query:

LOAD CSV WITH HEADERS 
FROM 'file:///xxx.csv' 
as rowStore FIELDTERMINATOR ';'

		CALL {
			WITH rowStore
			MATCH (store:Store {uuid: rowStore.uuid})
			RETURN store as x;
		}
RETURN x;

which returns the following error, that I cannot explain. I simplified the query to its minimal, but still cannot understand:

Neo.ClientError.Statement.SyntaxError: Invalid input '': expected
  ","
  "CALL"
  "CREATE"
  "DELETE"
  "DETACH"
  "FOREACH"
  "LIMIT"
  "LOAD"
  "MATCH"
  "MERGE"
  "OPTIONAL"
  "ORDER"
  "REMOVE"
  "RETURN"
  "SET"
  "SKIP"
  "UNION"
  "UNWIND"
  "USE"
  "WITH"
  "}" (line 8, column 21 (offset: 211))
"			RETURN store as x"
                     ^

} RETURN x

1 ACCEPTED SOLUTION

try removing the colon on the subquery return clause.

View solution in original post

6 REPLIES 6

I'm not sure about it but I think it's because aliases ( AS ) are not supported inside a subquery.

try removing the colon on the subquery return clause.

Right, I didn't even saw it. I did way too much javascript I guess

Gotcha!!! Thank you!

By the way, I double checked the doc about sub queries and yes there are some limitations about it but you can safely use AS in the return of a sub query.

Apart of javascript (and in the latest versions it's more intelligent about delimiters), I remember that in cypher return is always been followed by a semicolon