Hi Franklin;
Method#1:
Have a look at the DW Control / DataStore's "Modify" command. You can use a CREATE statement within that to add any number of columns you want at run time. For example ...
DC.Modify("create column( id=<an integer> tabsequence=<an integer> accelerator='<a single letter>' ...'" )
Tip: use the DWSyntax utility to build the syntax for the Modify/Create
Method#2:
Have a look at the Syntax from SQL command to add DWO columns at run time as another alternative. For example ...
String ERRORS
String sql_syntax
string presentation_str
String dwsyntax_str
sql_syntax = "SELECT emp_id, emp_name "
IF Extra_Required = TRUE THEN
sql_syntax += ", emp_salary, emp_phone "
END IF
sql_syntax += " FROM emp_data WHERE emp_data.emp_salary > 45000"
presentation_str = "style(type=grid)"
dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax, presentation_str, ERRORS)
dw_1.Create( dwsyntax_str, ERRORS)
HTH
Regards ... Chris