 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
Code snippets bug while using $$ |
|
Hello
I tried to define snippet for DO LANGUAGE construct as follows:
 |
 |
DO LANGUAGE $$
DECLARE
BEGIN
|
END $$; |
With following syntax SA fails with error:
 |
 |
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 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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
$$..$$ 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"
|
|
Sat Nov 07, 2015 1:55 am |
|
 |
michalk
Joined: 29 Aug 2014 Posts: 211
|
|
|
|
Works like a charm. Thank you.
|
|
Tue Nov 10, 2015 8:51 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|