The following code shows how to create a csv file
CommaIo file;
container line;
TableName table;
FileIoPermission perm;
#define.ExampleFile(@"c:\test\filename.csv")
#File
perm = new FileIoPermission(#ExampleFile, #io_write);
perm.assert();
file = new CommaIo(#ExampleFile, #io_write);
file.outFieldDelimiter(',');// for semicolon separator
if (!file || file.status() != IO_Status::Ok)
{
throw error("File cannot be opened.");
}
while select spools
{
line = [table.fieldName1, table.fieldName2, table.fieldName3, variable];
file.writeExp(line);
}
CodeAccessPermission::revertAssert();
please, what variable type is "spools" ??
ReplyDeleteReplace spools with the table name instance
ReplyDelete