Trying to replace text but getting an error.

  • 8Views
  • Last Post 4 weeks ago
  • Topic Is Solved
0
votes
Thomas Azar posted this 4 weeks ago

Trying to manipulate datae grabbed from salesforce and insert it in the correct formatting into a MySQL database. I am getting an error thrown while trying this. 

 

"["+REPLACE(Area_of_Practice_National_Attorneys__c, ";", ",")+"]"

 

I am also needing to add double quotes inside the strings of text and replace, but this will throw an error as double quotes already declare a string in your platform. 

The function "REPLACE" does not support the data type "DT_NTEXT" for parameter number 1. The type of the parameter could not be implicitly cast into a compatible type for the function. To perform this operation, the operand needs to be explicitly cast with a cast operator.

0
votes
Dmitriy Muzurov posted this 4 weeks ago

Hi Thomas,

Thank you for submitting a ticket with us.

You can use this expression:

"\"" + "[" + REPLACE((DT_WSTR,50)Area_of_Practice_National_Attorneys__c, ";", ",") + "]" + "\""

It will replace this value - example;

with this one - "[example,]"

If you don't need square brackets, the part "[" + can be removed from start and end of the expression.

Should you have any questions, do not hesitate to contact us back.

Close