# Inserting Data into SQL database using OPCUA subscription mode

**URL:** https://discourse.nodered.org/t/inserting-data-into-sql-database-using-opcua-subscription-mode/85691
**Category:** General
**Tags:** database, opcua, mysql
**Created:** [20 February 2024 08:32 UTC](https://discourse.nodered.org/t/inserting-data-into-sql-database-using-opcua-subscription-mode/85691 "2024-02-20T08:32:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shubhamnodered](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@shubhamnodered](https://discourse.nodered.org/u/shubhamnodered)
#### Post date: [20 February 2024 08:32 UTC](https://discourse.nodered.org/t/inserting-data-into-sql-database-using-opcua-subscription-mode/85691/1 "2024-02-20T08:32:31Z")

</div>

Hi Guys!

With OPCUA read node and MySQL node, i can inject the PLC value into SQL database. And table looks as below.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/f/4f08477dbb2223ed6a603bbb3218c2301a96edd1.png)

What i like to know that with OPCUA subscribe node, is it possible to feed data into SQL database as well. Because with subscription, we get only those values in node-red flow which changes. As a result i cannot able to form the array to insert values into SQL database. I cannot able to figure out how to push the data in the SQL table in the same manner as we did with read mode.

Everywhere in tutorial/ YT videos, peoples have used 'OPCUA read mode' instead of 'OPCUA subscribe mode' to log PLC data from node-red to SQL databases. Why is that? I mean why people do not use subscribe mode to log data into databases. Isn't it is categorically stated that subscribe mode reduces the load on the PLC?

Thanks in Advance!

---

<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: [20 May 2024 08:33 UTC](https://discourse.nodered.org/t/inserting-data-into-sql-database-using-opcua-subscription-mode/85691/2 "2024-05-20T08:33:04Z")

</div>

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