on 02-18-2015 11:24 AM
Hi Experts,
We have IDoc to JDBC scenario in our project. This interface is working fine but we have material description filed length (40 chars) when there is an apostrophe( ' ) coming at end of the material description(40th position) ( ex: AVEVDERIVC C NP VIUYA CSEMEWEA UYV ABC' ) , the message is failing in receiver JDBC channel. In PI We have replacing single quote with two quotes, after executing the PI mapping the field value converts ('AVEVDERIVC C NP VIUYA CSEMEWEA UYV ABC''), in this case we need to remove apostrophe( ' ) at 40th position. as per my understanding if the apostrophe are in odd number while sending to DB it is giving an error. Kindly do help me how we can handle this logic in PI.
Regards,
Sanjay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your reply, i want to remove 40th position single quote,if the apostrophe(') comes at 40th position then we need remove that.we will get apostrophe at middle and starting as shown below,
EXample:
input : AVEVDERIVC' C NP VIU CSEMEWEA' UYV ABC'
OutPut : AVEVDERIVC' C NP VIU CSEMEWEA' UYV ABC
My case Replace String function is not working.
Please help me on this.
Regards,
Sanjay.
Hi Ram,
Thanks for your reply, material description length is 40 chars at DB side, few material description does not have apostrophe. here first i am trimming the desc length to 40 chars and replace all single to double quote and then i am adding apostrophe at starting the field value and end of the field value('Snjay'). if we got 40 chars length description end with apostrophe then PI is adding one more apostrophe. while executing the SQL query in between the apostrophe taking as string, i have explained in my first post it is having 3 apostrophe, SQL query is searching for another closing apostrophe. As we had discussed with functional team regarding this issue they have suggested if field value is 40 chars end with apostrophe then we remove the apostrophe at end and sending 39 chars to DB or we will send the data same to DB what we are getting from ECC. could you please help us how we can handle this issue. highly appreciated.
Regards,
Sanjay.
hi,
if field value is 40 chars end with apostrophe then we remove the apostrophe at end and sending 39 chars to DB or we will send the data same to DB what we are getting from ECC
the below UDF checks whether you have apostrophe at 40th position or not if it has it ll remove that , if it doesn't then same value will be passed :
if(var1.lastIndexOf(''')==40)
{
return var1.substring(0,40);
}
else
{
return var1;
}
In the receiver channel try giving the SQL Syntax parameter > use Escape symbol for Apostrophe '
or modify the Target structure to handle hasQuot attibute as "YES".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Snjay,
As per my understanding replace string should work ,just replace the string which you want to do.
else you write UDF to count 40 character and pass.
Regards
Naveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.