Replace a single quote with a double single quote
My current file however has regular apostrophes (straight single quotation marks).
The below solution successfully escapes the apostrophe, so my DB Query doesn’t fail. But it’s not retrieving data from my table as the apostrophes don’t
Example:
My source element:
<name>Côte d'Ivoire</name>
DB table value:
Côte d'Ivoire
Value generated by my local variable :
Côte d'’Ivoire
The only way to make it work in the data mapper debugger is to manually adapt the apostrophe in both source input and DB table to a right single quotation mark.
So how do I either:
- Replace the apostrophe(') in the source to two right single quotation marks (’’)?
- Replace the apostrophe(') in the source to two apostrophes ('')
-
For achieving your requirement we would suggest you to first concatenate the two single quote using concat($apos,$apos), then use replaceAll( ) method of Mapper Utility Functions for replacing single ' to ''.
For more information on mapper utility class refer the screenshot and the below link.
http://support.adeptia.com/entries/21261932-Guide-to-Mapper-Utility-Class-of-Global-Methods0
Please sign in to leave a comment.
Comments
1 comment