cancel
Showing results for 
Search instead for 
Did you mean: 

escape character for apostrophe ' in JDBC receiver channel

Former Member
0 Kudos

Hi all,

We have Proxy to JDBC scenario in our project. This interface is working fine with unicode data but when there is an apostrophe( ' ) coming in any of the field values ( ex: DOWTHERM 'J' MODEL19QAGB1G ) , the message is failing in receiver JDBC channel.

can anyone please tell us how to handle single quote in JDBC receiver channel.

I have read in SAP help documentation that apostrophe is a reserved character in SQL syntax and is therefore replaced by an escape character if it occurs within value strings. There is a option to JDBC receiver communication channel under "SQL SYNTAX PARAMETER" to specify the escape character for apostrophe.

Can any please tell us which value needs to be maintained in the channel to avoid this error.

Regards

Jagruthi

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>There is a option to JDBC receiver communication channel under "SQL SYNTAX PARAMETER" to specify the escape character for apostrophe.

just select it and leave the default value

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

what will be the default value. We have tried with '', '''', '" , \' but nothing worked.

Regards

Jagruthi

prateek
Active Contributor
0 Kudos

Add a condition in mapping that when you receive single quotes ' replace it by two single quotes ''. Note that the last symbol is not a double quote but two single quote. If this doesn't work, add "hasQuot" attribute to your field which should surely work as mentioned below.

/people/prateek.srivastava3/blog/2009/04/02/unicode-handling-for-ms-sql-server

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

we have already added hasQuot attribute the database field. Special characters are getting sucessfully inserted into database using this but the message fails if it has single quote (apostrophe) in that field value.

Please suggest if there is any alternative solution.

Regards

Jagruthi

prateek
Active Contributor
0 Kudos

Have you read and followed my complete answer?

Regards,

Prateek

prateek
Active Contributor
0 Kudos

To add, use two single quotes for SQL SYNTAX PARAMETER Escape symbol too. Follow the first point of my previous reply.

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

Thanks a lot for you inputs.

This issue is solved now. We have replaced single quote with two single quotes and then did the hasQuote mapping as described in the blog.

/people/prateek.srivastava3/blog/2009/04/02/unicode-handling-for-ms-sql-server

No value needs to be maintained in channel(SQL SYNTAX PARAMETER ).

But just want to understand the difference between replacing the ' with '' in mapping and using SQL SYNTAX PARAMETER option in communication channel.

Both should ideally result in same output. But it didnu2019t work when we tried with two single quotes in SQL SYNTAX PARAMETER (Escape Symbol for Apostrophe) in communication channel without doing anything in mapping.

Regards

Jagruthi

former_member309357
Participant
0 Kudos

Hi Jagruthi,

    I am getting the same issue, could you please help me out. Request you to elaborate step by step on this issue.

Thanks

Ravi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Refer this blog...

/people/community.user/blog/2008/05/05/implementing-a-java-mapping-in-sap-pi-to-remove-escape-sequences-from-a-file

Hope this might be helpful for you!!

Regards,

Sainath Chutke