Search code examples
symmetricds

How to concat two columns in source node into one column in target


Is there any way to concat two column values in source, and copy the result in one column in the target node using SymmetricDS?

Thanks in advance


Solution

  • Use a Shell Script Transformation (bsh). From the documentation:

    This transformation allows you to provide a Bean Shell script in transform expression and executes the script at the time of transformation

    From symmetricds support discussion:

    If you are using a bash column transform, data for all columns in the row being processed are available. Within your script, the column is available as a pre-defined String variable with the column name. For example, if your row has a NAME column, you can write bean shell code such as return NAME.substring(0,4) to truncate a name to the first four charaters.