tomok wrote:This is a very common problem in SQL since the apostrophe is a reserved character. I should know since my last name has an apostrophe in it and I can't tell you how many times a web site won't work for me because the numb-nuts programmer didn't take it into consideration. It's easy, just replace the apostrophe (') with a double apostrophe ('') and the SQL will work. Since TM1 doesn't have a replace function you'll have to use a combination of SUBST and INSRT.
Tomok, many thanks for your reply. That makes sense.
I'm still a bit stuck though. The data source is a cube view so the value variable can sometimes be numeric, sometimes string and sometimes a string with an apostrophe.
Would you perform the insertion of the double apostrophe within the advanced data tab script or within a new variable?
I have tried the following:
I have created another variable called vQualifiedString and put the following formula in:
Code: Select all
vQualifiedString=
IF(SCAN('', vValue)=0,vValue,
INSRT(vValue, '',SCAN('', vValue)));
Changed the TI script to reference vQualifiedString rather than vValue.
The ti still aborts on the same record where the value is a name with an apostrophe in it.
I must be doing something wrong ...