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

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

The data coms from here GET:

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

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

  • 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?

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?

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 :slight_smile:

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

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