This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Database Connector Synchproject how to handle SQL apostrophe

Hello all,

we all know the issue with  handling String values that includes an Single apostrophe ( ' ).

This issue can be easily solved with escaping the apostrophe (i.e. double-up the single quote character) in your SQL statement.

My issue at that point is that I need to replace the value with an single apostrophe at 2 places, which makes no sense for me.

First, I need to replace it in the database synch project code for inserts and updates and secondly I need to replace it in addition in each attribute mapping for String values within a virtual property.

If one replace is not available, the synch is running into an error.

Is this how it should work, or do I miss something here?

Thanks, Fatih

  • Hi Fatih,

    can you please specify which DB connector did you use and what Version?

    Thank you

  • Hello Markus,

    sorry for missing that.

    I am using version 7.02 and the generic ADO.NET Connector that is connection to an DB2 database.

    Thanks Fatih

  • I have taken a look at your screenshot and i am wondering why you are creating SQL code in your scripted property.

    In addition, yes you have to escape the single quote in your ADO.NET Commit script, but where do you have problems in your synch? The connector should read single-quotes without issues.

  • Hello Markus,

    the screenshots might be confusing. There are two screenshots. The first screen is from the mapping and the second is in the ADO.NET Commit script.

    As you said, I am escaping my single quotes in my Commit script and the connector have no problems in reading values with single-quotes. Despite my escaping, I receive following error message in the Synch Log:

    I tried to pass following value: "Test'String" 

      

    I am wondering at that point, why I receive this error message and where my escaping is gone. In a follow up, I tried an additional escaping for this value in the mapping and than it works.

    Somehow, my escaping in the ADO.NET Commit script doesn't work.

    Any ideas?

    Thanks, Fatih

  • Hello all,

    it came out that there is a bug at that point.

    The hotfix will came out on 7.03 and 7.1 and fix that bug with the number: #26408

    Thanks, Fatih