I have the following TI set up to export the cell annotation to a sql table:
Data source: Cube view of }CellAnnotations cube
Variables: as per the cube plus 4 extra that scan the value to find the creator name, timestamp and comment etc. All variables set to other.
Advanced Prologue:
Code: Select all
ODBCOpen('COLUMBUS_TM1_PUBLISH','TM1_ADMIN','admin');
Code: Select all
AsciiOutput('D:\_BI\TM1_Application\TM1_Production\Output\Cell Annotation\Annotation', vMonth, vProbability, vGrossNet, vName, vProductionType, vVersion, vMeasure , vCreator, vTimeCreated, value, vComment);
value = STR(CellGetN('Forecast Input by Month',vMonth,vProbability,vGrossNet,vHierarchy,vProductionType, vVersion,vMeasure), 4, 2);
ODBCOutput('COLUMBUS_TM1_PUBLISH', Expand( 'INSERT INTO [COLUMBUS_TM1_PUBLISH].[dbo].[PRODUCTION_ANNOTATION] ([Month], [Probability], [Hierarchy], [Gross or Net], [Production Type], [Version], [Measure], [Creator], [Time Created], [Value], [Comment]) VALUES ("%vMonth%", "%vProbability%", "%vName%", "%vGrossNet%", "%vProductionType%", "%vVersion%", "%vMeasure%" , "%vCreator%", "%vTimeCreated%", "%value%", "%vComment%")'));
the ODBCOutput results in the TI aborting with the following error:
Not the most informative error message.Data Source line (1) Error: Data procedure line (42): Error Executing SQL query: "..."
If I copy and paste the "INSERT INTO..." into SQL it works but only if I replace the "% with '
Any advice would be much appreciated.
Many thanks