Export Sqlite data to CSV file

I am working on export report in csv file from sqlite database. I have used CSV node and It is working fine but when I debug file node it gives empty result. I am little bit stuck.

What do you mean, when you debug file node?

It is CSV node output. I can share flow.

[{"id":"8c6db192.7e7d","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"d0e8783f.d2d828","type":"ui_button","z":"8c6db192.7e7d","name":"","group":"89ea92be.2a899","order":2,"width":0,"height":0,"passthru":false,"label":"Report Download","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"select * from sensor_aggr","x":150,"y":380,"wires":[["c889c718.cf1b98"]]},{"id":"942a4fd1.b978f","type":"file in","z":"8c6db192.7e7d","name":"Report generate","filename":"C:\\Users\\Enerzon Automations\\.node-red\\Report.csv","format":"lines","chunk":false,"sendError":true,"encoding":"none","x":760,"y":340,"wires":[[]]},{"id":"c889c718.cf1b98","type":"sqlite","z":"8c6db192.7e7d","mydb":"9dd4ecf7.ee476","sqlquery":"msg.topic","sql":"","name":"DB","x":330,"y":380,"wires":[["374aff.6853e502"]]},{"id":"b78af7d6.9b17f8","type":"debug","z":"8c6db192.7e7d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":750,"y":400,"wires":[]},{"id":"374aff.6853e502","type":"csv","z":"8c6db192.7e7d","name":"","sep":",","hdrin":"","hdrout":false,"multi":"one","ret":"\\n","temp":"epoch,device,sensor,value","skip":"0","x":510,"y":380,"wires":[["942a4fd1.b978f","b78af7d6.9b17f8"]]},{"id":"89ea92be.2a899","type":"ui_group","z":"","name":"SensorData","tab":"d78a1ced.899ba","order":2,"disp":true,"width":"6","collapse":false},{"id":"9dd4ecf7.ee476","type":"sqlitedb","z":"","db":"C:\\Users\\Enerzon Automations\\EnerzonDB.db","mode":"RWC"},{"id":"d78a1ced.899ba","type":"ui_tab","z":"","name":"Dashboard","icon":"dashboard","order":1}]

So what is not working?

Do you realise that you have used a File In node, which reads a file. What exactly are you trying to do?

1 Like

Damn! It was my blunder. I forgot to see in hurry. I haven't seen read and write node. Thanks man you are rock.