Menu

CONCAT

2010-07-16
2012-12-07
  • Gary Kephart

    Gary Kephart - 2010-07-16

    I seem to be having some problems with the CONCAT function. At first, I was using the ORacle shortcut of a||b||c, but jsqlparser could not parse that. So, I changed it to CONCAT(a, CONCAT(b,c)) since Oracle's CONCAT can only take two args. jsqlparser doesn't seem to be able to handle nested functions.

     
  • Gary Kephart

    Gary Kephart - 2010-07-16

    Nevermind on the handling of nested functions. That was my fault.

     
  • zheng han

    zheng han - 2010-09-10

    hi
    you can use "||" for your concat.
    just extend the BinaryExpression class, overriding the getStringPresentation() to return a string "||"
    then add "||" operator( near "+" and "-") to JSqlParser.jj file.
    and you can write a || b || c instead of CONCAT(a, CONCAT(b,c))

    br

     
  • Nobody/Anonymous

    Would'nt it be a better approach to add || to the grammer itself?

     
  • Leonardo Francalanci

    added || to the grammar, please check version 0.6.6

     

Log in to post a comment.