Skip to main content

B1UP: Merging strings in HANA using ||

Comments

2 comments

  • Andrew Phillips

    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

    0
  • Luke Dunn

    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

     

     

     

     

    0

Please sign in to leave a comment.