Today I faced a strange problem.
At Neo4j Desktop browser I ran below code expecting that code will initialize two parameter variables. But it threw error to me
:param x => "value 1";
:param y => "value 2";
:param x => "value 1"
// // // :param y => "value 2"
Neo.ClientError.Statement.SyntaxError: Invalid input ':': expected (line 4, column 1 (offset: 9))
":param y => "value 2""
Then I tried to run comment section of differently
1 :param x => "value 1";
:param y => "value 2";
:param (and anything starting with a
:) isn't actually Cypher, but instead will be interpreted as a command for the application (in this case, the Neo4j Browser).
As such, don't expect the browser commands to interpret comments the way Cypher does, since they will never be interpreted by the Cypher engine.
In most cases, since commands are usually short, there shouldn't be many cases where you would need to have comments.
This is not about :. this problem is posted by Roy too Syntax error around Cypher comments.
Somehow for me it is only reproducible with param.
In any language if some symbol is used as comment then ideally engine should skip those line as Cypher also did in the browser at several instances.
I have not tried the same to reproduce the issue out of browser, however I am still feel that throwing an error is issue irrespective or cypher/browser.
I am not sure looks like by mistake I marked it as Solution.
You likely would not be able to reproduce this out of the browser with
:param, excepting cypher-shell, as it would error out as invalid syntax. As mentioned, the
: commands, including
:param are not cypher. They are not interpreted as Cypher, nor executed as Cypher. They are intercepted and interpreted by the application (the Neo4j Browser or Cypher-shell) and cannot be otherwise used by the Neo4j drivers, because these commands are not Cypher, so the Neo4j server itself doesn't know what to do with it.
That said, it does make sense to have the browser recognize comment characters when it interprets commands, and even between statements and/or commands when the multi-statement query editor is being used. I'll see if I can add that as a backlog item for the browser.
I do not know how to execute multiple statements in one shot using Cypher shell. However I completely rely on you that this is Neo4j browser issue, which needs to be fixed.