Problem:
We currently have problems with the || -syntax used by HANA in B1UP macros. The problem occurs when you're trying to use || for example in the Set();-function like this:
SET($[$108.0.0]|SQL: SELECT 'HELLO' || 'WORLD' FROM DUMMY);
The issue is that | is used as a parameter separator in the macro language. This leads to the macro system detecting the | as a part of the macro language. The line above will actually be split into:
SET($[$108.0.0]|SQL: SELECT 'HELLO'
|
| 'WORLD' FROM DUMMY);
By the macro system which does not make any sense in the macro language.
Solution:
Currently, we can't find a good solution to curb the issue as we cannot change the macro languages use of | without breaking all macros.
We recommend using the CONCAT -function instead of || like this:
SET($[$108.0.0]|SQL: SELECT CONCAT('HELLO', 'WORLD') FROM DUMMY);
Comments
2 comments
Hi Thomas,
I don't suppose you guys happen to have implemented in a better handling on this HANA syntax yet did you? It's very painful having to use multiple concat syntax when combining more than just 2x fields.
Thanks
I have come up with a work around to this issue so you don't have to stack CONCAT() and make a huge mess of code if you need to concatenate multiple strings.
It is possible to do something like this:
@Store1 = sql(select 'string1' || 'string2' || 'string3' from dummy);
set($[$ItemSytax.0.0]|@Store1)
If you need to make a line break between string you can do this:
@Store1 = sql(select 'string1' || '<NEWLINE>' || 'string2' from dummy);
set($[$ItemSytax.0.0]|@Store1)
If you are making a large string be wary of the data types of the fields you are passing in so that you don't get errors.
I hope this helps whoever comes across it. :)
-Luke
Please sign in to leave a comment.