How can I use ## in my scripts for Runtime
Situation
I have a script in my project (Privacy. Subset, Integrate) that contains two hashes (##)
I've noticed that the velocity engine, which is used to parse scripts, treats this as a comment and ignores the rest of the line.
However, I need this code. How can I use it?
Explanation
There is a way to achieve this.
All scripts are parsed using the velocity engine. To prevent specific content from being parsed, you can mark it as "Ignore for Parsing."
You can do this by enclosing the code within #[[ and ]]#.
Example 1
Create a MS SQL Server global table:
#[[
CREATE TABLE ##GlobalTemp
( UserID int, Name varchar(100), Address varchar(100) )
GO
]]#
Example 2
Use hashes in my sql condition
#[[
select sp.*
from s_person sp
where concat(sp.nam , '#'
,sp.num , '#'
,sp.nom , '#'
) <> '###'
]]#
Related articles
velocity, scripting, runtime