Code 7, State 42601, ERROR: syntax error at or near "|"; Error while executing the query
Executing user-defined query in line 1 ... Failed

If I remove pipe character, then get error:

Code:

Code 7, State 42601, ERROR: syntax error at or near "END"; Error while executing the query
Executing user-defined query in line 1 ... Failed

After removing double-dollars, it works as expected.

PS. Tested in SQL Editor

Thu Nov 05, 2015 6:15 am

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6484

$$..$$ is a special macro in that SQL Assistant uses in code snippets for executing custom SQL queries during macro execution. The results of the queries is dynamically expanded and inserted into the snippet code. So that is not a bug, it's a feature. Please see the documentation for more details.

If you need literal $ symbols in the code, you need to escape them, in your case you would use $^$^. There is an example in the documentation, see "Escaping $ Symbols in Snippet Codes"