Below is the sample procedure to write data out into a csv file.
However, I haven't found a way to set the width and precision of the numeric 'Capacity' column which should be written out with 3 decimal places (by default, it is rounded to the closest integer by the CSVProvider).
empty DataMap;
dl::DataTables += {'Capacity'} ;
DataMap(dl::dt,dl::idn,dl::cn,dl::dn) := data {
( 'Capacity', 'Store' , 1, 1 ) : "Store",
( 'Capacity', 'Capacity' , 2, 0 ) : "Capacity"
};
dl::RemoveDataSourceMapping("TheMapping");
dl::AddDataSourceMapping("TheMapping", DataMap, dl::DependEmpty, dl::TableAttributesEmpty, dl::ColAttributeEmpty);
spCommunicationAttributes := { 'DataProvider' : csvprov::DataLink ,'ContainsHeaders' : "yes", 'Separator': ","};
dl::DataWrite(CurrentFolder, "TheMapping" , spCommunicationAttributes);
I have the identifier spColAttr(dl::colattr) but couldn't really found how to refer to its values.
Could you please advise if I need to create further identifiers and how to set the precision and width of the csv?