Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: ejonesOh good. This is a situation I've seen before.
The answer is to change the BRAINscript to this:
emit *
where Data_Changed >= int("{{^RunDTM^}}") or Data_Created >= int("{{^RunDTM^}}")
The rule is, "all Run Parameters referenced in BRAINscript code must be surrounded by double quotes."
In this case following that rule turns the value into a string value and you must override this by converting it back to a number using the int() function.
The reason is a little difficult to explain but I'll try. Without the double quotes around {{^RunDTM^}} then the stuff in the parameter will be interpreted as BRAINscript code and compiled. There are two points of time involved, a) the time you create the BRX, and b) the time the BRX executes. To work correctly, all the BRAINscript code must be available when you create the BRX, but because the value in the Run Parameter is not available until the graph executes the BRX creation step is not able to work, it gets a bit flustered and gives you this error message about finding an unexpected "{" character.
So, think of it this way, when you are creating the BRX, the value in the Run Parameter causes the code to look like this. Note the {{$$}} is used internally to mark values that won't be available until the BRX executes.
emit *
where Data_Changed >= {{$RunDTM$}} or Data_Created >= {{$RunDTM$}}
But that code is not valid BRAINscript so it is unable to compile. And when you look at this version of the BRAINscript it makes more sense that it complains about an unexpected "{" character.
Now look at what happens when you put double quotes around the {{^RunDTM^}} value:
emit *
where Data_Changed >= int("{{$RunDTM$}}") or Data_Created >= int("{{$RunDTM$}}")
In this case, it is ok to not know the value until the BRX executes. The compiled version of the node can be saved in the BRX and a simple replacement operation when it executes can be done.