# Converting SQLite Query to a CSV File

**URL:** <https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937>\
**Category:** General\
**Created:** [31 July 2018 18:07 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937 "2018-07-31T18:07:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacharyalan09](https://avatars.discourse-cdn.com/v4/letter/z/a587f6/32.png) [@zacharyalan09](https://discourse.nodered.org/u/zacharyalan09)\
**Post date:** [31 July 2018 18:07 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/1 "2018-07-31T18:07:45Z")

</div>

Hello!

Quick question, I'm hoping you folks can help me out with. I've created an SQLite database to store time-based data about my system and want to create and export a .csv file of specific queries on demand.

So far I'm able to create a query, send the returned database results in a message, and convert to a CSV, and create a file; however, it looks like only a portion of the data is being transmitted.

There are 14 columns of data I expect to be exported, but only 5 are visible in the .csv file. See screenshots for output.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/329a5a60c3ee9ece8cf74a75ba6b1c4d5b6e746e.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/88c6f5a48bf8f1c9ba2fb0fca17c8806eec62985.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 July 2018 18:45 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/2 "2018-07-31T18:45:25Z")

</div>

How is the csv node configured ?

---

<div class="post-metadata">

**Author:** ![zacharyalan09](https://avatars.discourse-cdn.com/v4/letter/z/a587f6/32.png) [@zacharyalan09](https://discourse.nodered.org/u/zacharyalan09)\
**Post date:** [31 July 2018 19:18 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/3 "2018-07-31T19:18:07Z")

</div>

CSV node configured as shown.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/ad699289c7b8c66059858d95efa2006ada21e013.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 July 2018 20:57 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/4 "2018-07-31T20:57:29Z")

</div>

Your template line says things like bin50 which doesn’t match the debug that shows things like b50

---

<div class="post-metadata">

**Author:** ![zacharyalan09](https://avatars.discourse-cdn.com/v4/letter/z/a587f6/32.png) [@zacharyalan09](https://discourse.nodered.org/u/zacharyalan09)\
**Post date:** [31 July 2018 21:29 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/5 "2018-07-31T21:29:33Z")

</div>

That was it. Thank you! It works like a charm now.

---

<div class="post-metadata">

**Author:** ![Rapidsafeguard](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@Rapidsafeguard](https://discourse.nodered.org/u/Rapidsafeguard)\
**Post date:** [28 June 2019 12:29 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/6 "2019-06-28T12:29:36Z")

</div>

Hey Zacharyalan,  
Could you possibly share your flow? I am stuck in this function to export sqlite to csv.

Thanks

---

<div class="post-metadata">

**Author:** ![shipra](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@shipra](https://discourse.nodered.org/u/shipra)\
**Post date:** [21 September 2020 12:25 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/7 "2020-09-21T12:25:38Z")

</div>

Hey can you possibly share the flow ,i am unable to export sqlite to csv

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 September 2020 14:13 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/8 "2020-09-21T14:13:45Z")

</div>

@shipra, please don't ask the same question on multiple threads. Since you are working with Nick in the other thread and this thread is over a year old, I'm going to close it.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 September 2020 14:13 UTC](https://discourse.nodered.org/t/converting-sqlite-query-to-a-csv-file/1937/9 "2020-09-21T14:13:49Z")

</div>


