Customer Portal

MysqlBulkWriter issue with multiline DB column

Comments 2

  • Avatar
    nismon8er
    0
    Comment actions Permalink
    Ended up solving this.

    I still stripped out the "/n" but instead of replacing them with blank string "" I replaced them with a literal '/n' and let the MySQL Utility handle the line break.

    Worked like a charm
  • Avatar
    admin
    0
    Comment actions Permalink
    Hi there,

    You were right, your solution works like a charm.

    Let me just add to this topic, that in the replace function we might need to be aware of the right linefeed character based on the OS used. In my case, for example, I was working on a Windows machine and the linefeed is "\r\n" then. When transforming the string, I had to also escape the backslash character with another backslash so that the linefeed is replaced properly. Therefore I was able to achieve the goal by using the following function in the Reformat component:

    $out.0.Field4 = replace($in.0.Field4,"\\r\\n",'\\r\\n');

    This way the resulting field included the correct \r\n part of the string and has been interpreted by the MySQL database as a multiline string then.

    Best Regards,
    Eva

Please sign in to leave a comment.