WriteFile() creates a CSV file in your customer SFTP directory tree, from the results of an xSQL query.

Let’s create a file (periods.csv) in the directory we just created:

1 SQL> call WriteFile(FilePath= ‘{:v_my_dir}periods.csv’, FirstLineNames=true, Input=(select period_id, name, start_date, end_date from xactly.xc_period), Separator=‘|’, Quote=‘”‘);

Screen Shot 2016-06-06 at 3.23.12 PM