Hi guys,
I'm attempting to dynamically create staging tables for dimensions within OLAP in order to produce a 'Dimension View' of each dimension.
The logic is fairly straightforward, however when adding new columns and commiting the write I get an error;
Failed to execute bulk insert.
The relevant script snippet is as follows;
foreach( OLAPAttributeTable AttTable in AttTableList){
WriteLine(OLAPGetAttributeTableIndex(AttTable));
foreach(OLAPAttribute Att in AttTable){
WriteLine(Att);
SQLDataAddColumn(Table, ToString(Att), SqlDataTypeString, true); //This is the line that causes an issue
}
}
// StringDictionary Columns = SQLGetColumns(SQLCon, Table); -- the columns correctly update within the in-memory table
//int ColCount = Count(Columns); -- count confirms newly added columns
VariantList Row = CreateVariantList();
Append(Row, "Elem");
Append(Row, "Elem Parent");
Append(Row, 1);
Append(Row, 0);
Append(Row, "Test Attribute Field");
Append(Row, "Test Attribute Field2");
Append(Row, "Test Attribute Field3");
Append(Row, "Test Attribute Field4");
SQLDataInsertRow(Table, Row); //this works fine given the correct amount of columns are populated
SQLBulkInsertData(SQLCon, Dimension, Table); //This errors out only when a new column was 'added'
If i populate the rows with the existing columns i.e without running SQLDataAddColumn, it inserts rows fine. Any input would be great.
Version: V12, multi tenant.
Thanks