0
votes

I'd like to implement Cypher query and using APOC functions remove all of the existing triggers:

I'm trying the following query:

CALL apoc.trigger.list() yield name 
CALL apoc.trigger.remove(name) yield name, installed

but it fails with the following error:

Neo.ClientError.Statement.SyntaxError: Query cannot conclude with CALL (must be RETURN or an update clause) (line 1, column 37 (offset: 36)) "CALL apoc.trigger.list() yield name CALL apoc.trigger.remove(name) yield name, installed" ^

How to properly implement this query ?

1

1 Answers

1
votes

As the error says, a query cannot end with a CALL (unless the CALL is the only statement in the query). It needs either a write operation (MERGE, CREATE, SET, REMOVE, DELETE) or a return.

You can add RETURN name, installed at the end, if you want to return the values yielded by the call. Otherwise, if you really don't care about what is returned, RETURN DISTINCT true ought to do the trick.

Oh, and you may want to alias name in one of your YIELDs or the other, as you may get an error of a variable name conflict.