# How to interpeter the output from a MySQL INSERT

**URL:** https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822
**Category:** Dashboard
**Created:** [29 March 2020 11:07 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822 "2020-03-29T11:07:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Sep](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sep](https://discourse.nodered.org/u/Sep)
#### Post date: [29 March 2020 11:07 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822/1 "2020-03-29T11:07:09Z")

</div>

Hi,

where to get infos about the Mysql node return after a SQL operation?

I do a  
START TRANSACTION;  
INSERT INTO...;  
INSERT INTO...;  
COMMIT;

Everything looks fine on the database side and I get the following output, but how to know from those data that it went fine rather than I got a error?

```auto
array[4]
0: object
fieldCount: 0
affectedRows: 0
insertId: 0
serverStatus: 11
warningCount: 0
message: ""
protocol41: true
changedRows: 0
1: object
fieldCount: 0
affectedRows: 1
insertId: 2185
serverStatus: 11
warningCount: 0
message: ""
protocol41: true
changedRows: 0
2: object
fieldCount: 0
affectedRows: 1
insertId: 329
serverStatus: 11
warningCount: 0
message: ""
protocol41: true
changedRows: 0
3: object
fieldCount: 0
affectedRows: 0
insertId: 0
serverStatus: 2
warningCount: 0
message: ""
protocol41: true
changedRows: 0

```

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [29 March 2020 11:20 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822/2 "2020-03-29T11:20:22Z")

</div>

Why not try doing an insert with an error in it and see what you get out?

---

<div class="post-metadata">

### Author: ![Sep](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sep](https://discourse.nodered.org/u/Sep)
#### Post date: [29 March 2020 11:56 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822/3 "2020-03-29T11:56:44Z")

</div>

well, nice hint, but I was looking for directions to an error description table 😁

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [29 March 2020 12:25 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822/4 "2020-03-29T12:25:45Z")

</div>

Well in that case, you shoud go to the GitHub repositotary for the node and read thru the javascript of the node to see what it does 🤣

Seriously, in my mind the best thing to do is try it. It should take you 5 minutes and you will be able to look at the output and see if there is a difference. I don't know if there is any documentation to point you to....

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [29 March 2020 12:45 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822/5 "2020-03-29T12:45:21Z")

</div>

Well the node just reports back what mysql sends it - so really need to look at what sort of errors mysql would send... In the case you have - you send in 4 commands - and got an array of 4 results back (one for each command) - each has a warning count of 0 so I would l say it succeeded.

---

<div class="post-metadata">

### Author: ![Sep](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sep](https://discourse.nodered.org/u/Sep)
#### Post date: [29 March 2020 18:48 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822/6 "2020-03-29T18:48:04Z")

</div>

Thanks dceejay, will check this out.

---

<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: [28 April 2020 18:48 UTC](https://discourse.nodered.org/t/how-to-interpeter-the-output-from-a-mysql-insert/23822/7 "2020-04-28T18:48:10Z")

</div>

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