Page 1 of 1

Ampersand in SQL source.

Posted: Tue Jan 13, 2015 10:15 am
by cgaunt
Hello All,

I am using TM1 10.2.2 FP2 (not updated in my profile as I use many versions). I have observed something that I hope has been seen before and someone may have a resolution for.

I have a TI, created in Performance Modeller which brings in various lines to a TM1 cube from an ODBC source. It fails for just one line and that line contains an ampersand in one of the element records. All other lines are working as expected. I have an asciioutput on the data tab that also creates a file so I can see which records are being processed. The file is being created as expected, but does not contain any records that relate to the source items which contains the ampersand. This would indicate that the TI engine does not recognise these as valid records and is just negating them. The data tab contains just cellputn statements and sets a single variable.

I have amended the source SQL statement to show only the line containing the ampersand. I can see it in the TI preview, but when I run the process, no file is created on account of the asciioutput, indicating that the data tab does not execute.

I have also amended the SQL statement to contain CHR(38) in place of the ampersand, again, I can see the line in the preview, but no file is exported indicating that the data tab has not executed.

Has anyone else encountered such an issue with an ODBC source containing an ampersand and found a solution. If so, I hope you would be willing to share a resolution.

Re: Ampersand in SQL source.

Posted: Tue Jan 13, 2015 2:39 pm
by BrianL
Is the datasource column containing the ampersand mapped to a numeric or string column? I'd expect this behavior if TI is trying to convert string data into a numeric variable. That would fail before running any code from the data tab and skip the record.

Re: Ampersand in SQL source.

Posted: Tue Jan 13, 2015 3:44 pm
by cgaunt
Hello BrianL

Good call, but likely not the answer in this case. The source is a string and the column is formatted as a string. It is worth remembering that the other records are coming in correctly, it is just this one that is failing. The line syntax is 'DO Contractors, Temps - T&M'. Other lines have commas and dashes, the only thing unique to this line is the ampersand. Apart form defining the source without any manipulation, I have tried to amend the SQL query to escape the ampersand character with CHR(38) as well as an underscore, again I still see them in the preview, but not when the TI runs.

The only other anomaly here is that the map between the source and the dimension occasionally drops and has to be remapped. I cant make it replicable on any specific action, so I can only assume that it happens at 'high tide' and I am too far in land to have access to the tide charts.

Any other thought appreciated.

Re: Ampersand in SQL source.

Posted: Wed Jan 14, 2015 3:05 pm
by BrianL
Do you get any log messages from TI for that record? Usually if a record is skipped you should get a log message explaining why.

What is your SQL column type? I did a quick test with SQL server 2005 and a varchar(50) column type but TI didn't have any issues.