cancel
Showing results for 
Search instead for 
Did you mean: 

How replace Apostrophe(') in communication channel?

Former Member
0 Kudos

Hi All,

I am working on file to jdbc scenario. The DB is AS400 system.

I am passing this as my source data:


<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_DeptSender xmlns:ns0="http://mindtree.com/xi/m1004968">
  <IPROD>005</IPROD> 
  <IDESC>P/B/PEPPERONIPI</IDESC> 
  <ICLAS>24</ICLAS> 
</ns0:MT_DeptSender>

I tried passing the data directly without any quotes first because of which I got this error in receiver CC:

Error 'java.sql.SQLException: The number of parameter values set or registered does not match the number

of parameters.' executing service raw2sql with SQL statement '<?xml version="1.0" encoding=

"UTF-8"?> <ns0:MT_DeptReceiver xmlns:ns0="http://mindtree.com/xi/m1004968"><STATEMENTNAME><TEST action="INSERT"><TABLE>datalib.iim</TABLE><access><IPROD>005</IPROD><IDESC>P/B/PEPPERONIPI</IDESC><ICLAS>24</ICLAS></access></TEST></STATEMENTNAME></ns0:MT_DeptReceiver>'

After this I tried inserting the data in target DB ie in AS400 using insert query. The INSERT query which works there in that system is:

INSERT INTO DATALIB/IIM (IPROD, IDESC, ICLAS) vALUES(005, 'P/B/PEPPERONIPI', '24')

Two character fields here are bounded by quote('). So i changed my source file to this:

<ns0:MT_DeptSender xmlns:ns0="http://mindtree.com/xi/m1004968">

<IPROD>005</IPROD>

<IDESC>'P/B/PEPPERONIPI'</IDESC>

<ICLAS>'24'</ICLAS>

</ns0:MT_DeptSender>

ie., am passing the character fields along with single quote(') for those 2 fileds.

This time I am getting this error in CC:

Error 'java.sql.SQLException: The number of parameter values set or registered does not match the number of parameters.' executing service raw2sql with SQL statement '<?xml version="1.0" encoding="UTF-8"?> <ns0:MT_DeptReceiver xmlns:ns0="http://mindtree.com/xi/m1004968"><STATEMENTNAME><TEST action="INSERT"><TABLE>datalib.iim</TABLE><access><IPROD>& apos ;005& apos ;</IPROD><IDESC>& apos ;P/B/PEPPERONIPI& apos ;</IDESC><ICLAS>& apos ;24& apos ;</ICLAS></access></TEST></STATEMENTNAME></ns0:MT_DeptReceiver>'

CC here is taking " ' " as " & apos ; " and passing it to the target DB. How can I repalce this "& apos ;" with quote " ' " ?

Thank you,

Warm regards,

Deepak

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

In Receiver adapter under Processing tab, check the SQL Syntax Parameters.

Also go through this document and look into "SQL Syntax Parameters"

http://help.sap.com/saphelp_nw70/helpdata/EN/ae/d03341771b4c0de10000000a1550b0/frameset.htm

Regards,

Sarvesh

Answers (0)