# Inserting more than one record with the SQLITE nodes (standard/better)

**URL:** https://discourse.nodered.org/t/inserting-more-than-one-record-with-the-sqlite-nodes-standard-better/99013
**Category:** General
**Tags:** database, sqlite
**Created:** [11 September 2025 13:01 UTC](https://discourse.nodered.org/t/inserting-more-than-one-record-with-the-sqlite-nodes-standard-better/99013 "2025-09-11T13:01:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![GAZ082](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaz082/32/5911_2.png) [@GAZ082](https://discourse.nodered.org/u/GAZ082)
#### Post date: [11 September 2025 13:01 UTC](https://discourse.nodered.org/t/inserting-more-than-one-record-with-the-sqlite-nodes-standard-better/99013/1 "2025-09-11T13:01:13Z")

</div>

Hey there. I’m using sqlite for storing my sensor’s readings. Had to create a string this way otherwise i was not able to load multiple records in one go. Heck, i was not able to use the placeholders either. Is there a more elegant way to insert multiple records?

`msg.topic = insert into sensor_data (sensor_id, value, type) values (`  
`+ msg.payload.sensor_id + ,+ msg.payload.temperature + ,1),(`  
`+ msg.payload.sensor_id + ,+ msg.payload.humidity + ,2),(`  
`+ msg.payload.sensor_id + ,+ msg.payload.battery + ,3)`  
`return msg;`

Thanks!

---

<div class="post-metadata">

### Author: ![leftymuller](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/leftymuller/32/102326_2.png) [@leftymuller](https://discourse.nodered.org/u/leftymuller)
#### Post date: [12 September 2025 08:55 UTC](https://discourse.nodered.org/t/inserting-more-than-one-record-with-the-sqlite-nodes-standard-better/99013/2 "2025-09-12T08:55:03Z")

</div>

depending on the flow how you’ve done it is fine?

you could do it like this?

```auto
msg.topic = INSERT INTO sensor_data (sensor_id, value, type) VALUES ($1, $2, 1), ($1, $3, 2), ($1, $4, 3);
msg.payload =[msg.payload.sensor_id,msg.payload.temperature,msg.payload.humidity,msg.payload.battery];
return msg;

```

at the end of the day as long as you got data into the database in a timely fashion its a win 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 December 2025 08:55 UTC](https://discourse.nodered.org/t/inserting-more-than-one-record-with-the-sqlite-nodes-standard-better/99013/3 "2025-12-11T08:55:25Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
