# How to put an big array in to sql, not a possibility that I understand how to do, when there are so many threads with info

**URL:** <https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905>\
**Category:** General\
**Tags:** function-node\
**Created:** [10 October 2023 07:35 UTC](https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905 "2023-10-10T07:35:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![axdig](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@axdig](https://discourse.nodered.org/u/axdig)\
**Post date:** [10 October 2023 07:35 UTC](https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905/1 "2023-10-10T07:35:42Z")

</div>

This is the array, weather forcast that i want to put into a sql, i have dont have a clue how to do 🙂

The data coms from here GET: [https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/point/lon/15/lat/57/data.json](https://opendata-download-metfcst.smhi.se/api/category/pmp3g/version/2/geotype/point/lon/15/lat/57/data.json)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 October 2023 08:16 UTC](https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905/2 "2023-10-10T08:16:51Z")

</div>

I am afraid there is just not enough information or background to go on.

> [@axdig](#):
>
> a sql

Before anyone can help, you would need to state which database you mean?

> [@axdig](#):
>
> dont have a clue how to do

- Which part?
  - Installing and setting up a database node into Node-RED?
  - Creating a suitable table for the data?
  - Creating the SQL INSERT statement?
  - Grabbing the data from the URL?
  - Pushing the data to the database?

- Do you know how to write SQL and generate a SQL UPDATE statement?
- How familiar are you with Node-RED?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 October 2023 08:40 UTC](https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905/3 "2023-10-10T08:40:33Z")

</div>

> [@axdig](#):
>
> weather forcast that i want to put into a sql

Why do you want to store the forecast in a database - how do you intend to access and use the data?  
Your URL returns forecasts for 72 different time points - hourly to start with, 12-hourly for later days. So if you were to request the data just once a day, most of the data you stored in the db yesterday has been made redundant by the new forecast. Do you want to compare how the forecast for a specific time varies, or are you just interested in the most recent forecast?

Are you familiar with any flavour of SQL database?  
Node-red can interact with several different databases, eg Microsoft SQL Server, Mariadb (= MySQL), PostgreSQL etc. Several non-SQL databases too. It makes sense to stick with the kind you know.  
You will most likely need to install a contrib node for the specific database type.

What platform do you run Node-red on, and what platform will run the database server?

---

<div class="post-metadata">

**Author:** ![axdig](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@axdig](https://discourse.nodered.org/u/axdig)\
**Post date:** [18 October 2023 12:23 UTC](https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905/4 "2023-10-18T12:23:58Z")

</div>

Hi.  
Sorry i was busy whit other tings.  
i try to be more clear.  
I run Node-red 3,0,2 and MySQL Workbench 8,0

I will use the data for the latest forcast ( make own weather forcast to control the heat in large buildings)

But i am usless to stor data from arrays, don´t understand how to divide smrtly, and in same function like in this case both insert data and uppdate data.

I hope it was more cleat what i´m looking for 🙂

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 October 2023 12:30 UTC](https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905/5 "2023-10-18T12:30:57Z")

</div>

> [@axdig](#):
>
> I will use the data [from] the latest forcast ( make own weather forcast to control the heat in large buildings)

I see no need for a database if you are only using the latest forecast data.

---

<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:** [17 December 2023 12:31 UTC](https://discourse.nodered.org/t/how-to-put-an-big-array-in-to-sql-not-a-possibility-that-i-understand-how-to-do-when-there-are-so-many-threads-with-info/81905/6 "2023-12-17T12:31:05Z")

</div>

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