Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

How to export to .csv file in blulk?

$
0
0

Hi All,

I am looking for your expert comments.

The task is to read a table and create a .csv file containing records from the table.

The method I am using is:
 declare a container;
 in while loop, populate container and write to file
 while select table1
 {
  // Empty the container
             con = connull();

  con = conins(con, 1, table1.Field1);
             con = conins(con, 2, table1.Field2);
             con = conins(con, 3, table1.Field3);
  
  // Write the container to the file
  file.writeExp(con);
 }
My question is, is this the efficient way to create a .csv file?
the file.writeExp() is called for every single row in the table. Is there a way to write data all at once? Can you please comment on the efficient method to write to file.


Viewing all articles
Browse latest Browse all 72043

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>