0

I Am using Salesforce Bulk Package to login and query data(bulk)

job = bulk.create_query_job("User", contentType='CSV')
batch = bulk.query(job, "SELECT id, name FROM User limit 2")
bulk.close_job(job)
while not bulk.is_batch_done(batch):
   sleep(10)

for result in bulk.get_all_results_for_query_batch(batch):
    reader = csv.DictReader(result, encoding='utf-8')
    for row in reader:
        print(row)

The output for the following is OrderedDict([('Id', 'XXXXXXXXXXXXXX'), ('Name', Test1')]) OrderedDict([('Id', 'XXXXXXXXXXXXXX'), ('Name', 'Walter Paul')])

How to print the result into CSV File ?Please Help

SHK
  • 1
  • 1
    Possible duplicate of [How do I convert this list of dictionaries to a csv file?](https://stackoverflow.com/questions/3086973/how-do-i-convert-this-list-of-dictionaries-to-a-csv-file) – ljeabmreosn Nov 15 '18 at 01:07
  • its not working that way – SHK Nov 15 '18 at 01:33

0 Answers0