# Error: ER\_BAD\_FIELD\_ERROR: Unknown column 'RND0508A03A' in 'field list'

**URL:** <https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052>\
**Category:** General\
**Tags:** database, function-node\
**Created:** [25 May 2022 12:59 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052 "2022-05-25T12:59:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [25 May 2022 12:59 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/1 "2022-05-25T12:59:41Z")

</div>

Currently I have been working on a project where I need to transfer string data from PLC to MySQL through Node-Red. I created the database columns in MySQL(phpMyAdmin) and node flows in Node-Red .

 ![node flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/30e18544300a593701d21d3ec2f37ca423ee8ebd.jpeg)

But while debugging I am getting following message and error

 ![debugged message](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/5/b5b05e88d356bceddd4822005146e122f0392447.jpeg)

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [25 May 2022 13:00 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/2 "2022-05-25T13:00:24Z")

</div>

Here is my function code to pass string data towards mysql node.

 ![function](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/2/1245cb65073d920be28ed9d4a37fd2ff8d2b1070.jpeg)

Here are my columns in mysql database where I need to store the messages finally.

 ![mysql](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4ea2454b5c3c436abe0eef089ed1b5c10c2af466.jpeg)

Where I made the wrong during the process? Are the functions right to pass string data? How to resolve the error of ER\_BAD\_FIELD\_ERROR in mysql node and Error: Unknown column 'RND0508A03A' in 'field list' of 'Fastener Insert' node?  
Thanks in advance

---

<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:** [25 May 2022 15:19 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/3 "2022-05-25T15:19:12Z")

</div>

Since the data fields are all strings, shouldn't you wrap each value in quotes?

And each of those insert statements will create a discrete record containing just fastener type or production date or barcode. Is that really what you want?

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 07:48 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/4 "2022-05-31T07:48:59Z")

</div>

sorry for the late reply. Yes , I want what you mentioned actually. How should I do that? or what I need to change?

---

<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:** [31 May 2022 08:00 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/5 "2022-05-31T08:00:52Z")

</div>

> [@Show74](#):
>
> How should I do that? or what I need to change?

By either using single quotes `'` around the payload  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/5/b591925ddbc7afc077f4eb9f0977175e0f4bb95c.png)

The better solution is to use prepared queries.

From the [readme](https://flows.nodered.org/node/node-red-node-mysql)

> ## Preparing Queries
> 
> ```auto
> msg.payload=[24, 'example-user'];
> msg.topic="INSERT INTO users (`userid`, `username`) VALUES (?, ?);"
> return msg;
> 
> ```
> 
> with named parameters:
> 
> ```auto
> msg.payload={}
> msg.payload.userToChange=42;
> msg.payload.newUsername="example-user";
> msg.topic="INSERT INTO users (`userid`, `username`) VALUES (:userToChange, :newUsername) ON DUPLICATE KEY UPDATE `username`=:newUsername;"
> return msg;
> 
> ```

Using prepared queries avoids the need to use quotes (and avoids the problem when the string has quotes inside) and more importantly, protects your database from [SQL Injection](https://portswigger.net/web-security/sql-injection)

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 09:10 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/6 "2022-05-31T09:10:54Z")

</div>

Here I have used 5 different insert fucntions to encode five different values for MySQL database five columns fastener\_type, volume, production\_date, batch\_number and customer\_id. Should I use "join" node after five function nodes and again another insert function to encode five different string data values in MySQL database. In the last insert function node then I wrote the following statement:

```auto
msg.payload={}
msg.payload.fastenerType="RND0508A03A";
msg.payload.Volume=10000;
msg.payload.productionDate="30JUN2021";
msg.batchNumber=756917;
msg.customerID="9909854ß00"
msg.topic = "INSERT INTO barcode('fastener_type', 'volume', 'production_date', 'batch_number', 'customer_id') VALUES (:fastenerType, :Volume, :productionDate, :batchNumber, :customerID) ON DUPLICATE KEY UPDATE 'fastener_type'=:fastenerType;" 

return msg;

```

In that case my node flow looks like following:

 ![Screenshot 2022-05-31 110832 - 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/6386759ae831f1007f3251129bd5f3347a60fac1.jpeg)

Sorry again, As I am new in Node-Red, still now I am quite lost

---

<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:** [31 May 2022 09:16 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/7 "2022-05-31T09:16:26Z")

</div>

Share this flow and I will take a look - its too hard to explain without more intricate details (like which function is this? did you use topic names? what is the join node set to? what does the join node result look like) etc etc

So sharing your flow will help me help you.

---

<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:** [31 May 2022 09:19 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/8 "2022-05-31T09:19:16Z")

</div>

What is the structure of your "barcode" data table, what is the unique key?

When a message arrives in Node-red, for example Volume data, what does it look like?  
I assume this is a production quantity or similar. How do you know which product it is for?

You should probably tell us something about the timing of the different kinds of input messages too; a join node may not be the best way to go.

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 09:41 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/9 "2022-05-31T09:41:49Z")

</div>

I used five input nodes and got five different string values from PLC. Then I used insert function for each node and connected function node to MySQL node. In Fastener type insert function node I wrote following statement:

```auto
msg.topic = "INSERT INTO barcode(fastener_type) VALUES (" + (msg.payload) + ");"; 

return msg;

```

Like this I have used other insert functions such as volume, production date, batch number and customer id.

To get the debugged message I used join-node to join all five function nodes and got following messages  
 ![insert functions](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/d/5d095d8d794c1108f6ccb5d75e57966597f66347.jpeg)

But I got the error "Error: Unknown column 'RND0508A03A' in 'field list' for the following connection

 ![Screenshot 2022-05-31 113910 - 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a37615d611adf1da0f442ef0248163be9c80b6b7.jpeg)

But if everything goes right here my fastener type string data "RND0508A03A" should store in my MySQL database "barcode" table "fastener\_type" column.

---

<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:** [31 May 2022 09:53 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/10 "2022-05-31T09:53:30Z")

</div>

> [@Show74](#):
>
> To get the debugged message I used join-node to join all five function nodes and got following messages  
> ![insert functions](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/d/5d095d8d794c1108f6ccb5d75e57966597f66347.jpeg)

> [@Show74](#):
>
> But I got the error "Error: Unknown column 'RND0508A03A'

That is unsuprising.

You need to join the data parts THEN build a single insert query.

Again, share your flow and I will instruct you.

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 09:53 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/11 "2022-05-31T09:53:32Z")

</div>

My "barcode" data table structure is as following and key is DESC:

 ![mysql](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4ea2454b5c3c436abe0eef089ed1b5c10c2af466.jpeg)

Here is full node flows for my program:

 ![Screenshot 2022-05-31 114748 - 4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fa9668efa71725eaebea23219006b55ddf6b7808.jpeg)

Here red marked functions to write the string data in "barcode" data table and blue marked functions are used to read the data from "barcode" data table. I just connected one write function node Fastener Insert to check whether it can store fastener type data in "barcode" data table or not. But unfortuenately it can't store the value. I used following statements in the Fastener Insert function:

```auto
msg.topic = "INSERT INTO barcode(fastener_type) VALUES (" + (msg.payload) + ");"; 

//msg.topic = query;

return msg;

```

But for the above statement I got the following error: "Error: Unknown column 'RND0508A03A' in 'field list'".

So where I need to change to store my string data and what should I write? Please let me know if my problem is still unclear.

---

<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:** [31 May 2022 09:55 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/12 "2022-05-31T09:55:22Z")

</div>

You cannot do single inserts for each column - that is not how SQL works.

You need to gather all values into one message THEN build a single query e.g...

```auto
INSERT INTO myTable(id, fastener_type, thisval, thatval) VALUES (?, ?, ?, ?)

```

---

<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:** [31 May 2022 09:56 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/13 "2022-05-31T09:56:44Z")

</div>

> [@Show74](#):
>
> Here is full node flows for my program:

No, that is a picture of your flow. In order to help you further you need to export (`CTRL+E`) the flow and post it in a code block

`````  
`like this`  
`````

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 10:05 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/14 "2022-05-31T10:05:31Z")

</div>

In that case my node flows will be like following:

 ![Screenshot 2022-05-31 120241 - 5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78391e66bb46dc1256121e4dcb0039564b8bdbf8.jpeg)

but then what should I write in the funtions to write all five string data. because I have different message payload from different nodes?

---

<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:** [31 May 2022 10:11 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/15 "2022-05-31T10:11:09Z")

</div>

> [@jbudd](#):
>
> When a message arrives in Node-red, for example Volume data, what does it look like?

Show us a couple of examples of the data coming in to Node-red.

> [@Show74](#):
>
> My "barcode" data table structure is as following and key is DESC:

That table does not contain a field "DESC".

I don't use whatever that database exploration tool is (PhpMyAdmin?) so I might be wrong, but it looks like no field can be NULL and every field must be unique in the database.  
Is that correct? It seems unlikely.

---

<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:** [31 May 2022 10:23 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/16 "2022-05-31T10:23:45Z")

</div>

> [@Show74](#):
>
> but then what should I write in the funtions to write all five string data. because I have different message payload from different nodes?

ok, one last time.

> [@Steve-Mcl](#):
>
> In order to help you further you need to export ( `CTRL+E` ) the flow and post it in a code block
> 
> ```auto
> `like this`
> 
> ```

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 10:52 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/17 "2022-05-31T10:52:37Z")

</div>

Here is the exported flow for Fastener\_Type input node:

```auto
[
    {
        "id": "65f1b08076c1fc17",
        "type": "tab",
        "label": "2D_Barcode",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "7068f5728a61cb0c",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "Fastener_Type",
        "diff": true,
        "name": "",
        "x": 320,
        "y": 140,
        "wires": [
            [
                "1c267ac2c8ca52e0",
                "39dcfe77ea772eb6",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "39dcfe77ea772eb6",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Fastener Insert",
        "func": "//m = msg.payload\n//fastener = m.Fastener_Type\n//msg.payload=['RND0508A03A'];\nmsg.topic = \"INSERT INTO barcode(fastener_type) VALUES (\" + (msg.payload) + \");\"; \n\n\n//msg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1080,
        "y": 140,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "bc8eec020307c679",
        "type": "mysql",
        "z": "65f1b08076c1fc17",
        "mydb": "91ed457ccb906798",
        "name": "",
        "x": 850,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "1c267ac2c8ca52e0",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1070,
        "y": 200,
        "wires": [
            [
                "696a42d3469ec68b"
            ]
        ]
    },
    {
        "id": "696a42d3469ec68b",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function Fastener",
        "func": "var query = \"SELECT `fastener_type` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1350,
        "y": 80,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "f47a27fa3f488eac",
        "type": "mysql",
        "z": "65f1b08076c1fc17",
        "mydb": "91ed457ccb906798",
        "name": "",
        "x": 1590,
        "y": 340,
        "wires": [
            [
                "cf8c7775b4dd9199"
            ]
        ]
    },
    {
        "id": "404c5a7c1f90fc38",
        "type": "debug",
        "z": "65f1b08076c1fc17",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1790,
        "y": 720,
        "wires": []
    },
    {
        "id": "ea7558204b815481",
        "type": "ui_template",
        "z": "65f1b08076c1fc17",
        "group": "d97ce9c1f9cd1075",
        "name": "",
        "order": 1,
        "width": "6",
        "height": "8",
        "format": "<style>\ntable {\n text-align: center;\n margin: 50 auto;\n}\ntbody td{\n padding: 25px;\n background-color: rgb(230,254,255);\n}\nthead th{\n padding: 25px;\n background-color: rgb(69,69,69);\n color:#fff;\n border: rgb(36,149,255);\n}\n</style>\n\n<div>\n <table>\n <thead>\n <tr>\n <th>Fastener Type</th> \n <th>Volume</th> \n <th>Production Date</th> \n <th>Batch Number</th> \n <th>Customer Id</th> \n </tr>\n </thead>\n <tbody>\n <tr>\n <td>{{msg.payload[0].fastener_type}}</td> \n <td>{{msg.payload[0].batch_number}}</td>\n <td>{{msg.payload[0].customer_id}}</td>\n <td>{{msg.payload[0].production_date}}</td> \n <td>{{msg.payload[0].volume}}</td> \n </tr>\n <tr>\n <td>{{msg.payload[1].fastener_type}}</td> \n <td>{{msg.payload[1].volume}}</td> \n <td>{{msg.payload[1].production_date}}</td> \n <td>{{msg.payload[1].batch_number}}</td>\n <td>{{msg.payload[1].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[2].fastener_type}}</td> \n <td>{{msg.payload[2].volume}}</td> \n <td>{{msg.payload[2].production_date}}</td> \n <td>{{msg.payload[2].batch_number}}</td>\n <td>{{msg.payload[2].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[3].fastener_type}}</td> \n <td>{{msg.payload[3].volume}}</td> \n <td>{{msg.payload[3].production_date}}</td> \n <td>{{msg.payload[3].batch_number}}</td>\n <td>{{msg.payload[3].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[4].fastener_type}}</td> \n <td>{{msg.payload[4].volume}}</td> \n <td>{{msg.payload[4].production_date}}</td> \n <td>{{msg.payload[4].batch_number}}</td>\n <td>{{msg.payload[4].customer_id}}</td>\n </tr>\n </tbody>\n </table>\n</div>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 1860,
        "y": 640,
        "wires": [
            []
        ]
    },
    {
        "id": "a368340a154d3bea",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "volume",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 240,
        "wires": [
            [
                "fde9d49d065b53d2",
                "4e8f33bf039130c7",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "77d23295fbd0a7cd",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "production_date",
        "diff": true,
        "name": "",
        "x": 340,
        "y": 420,
        "wires": [
            [
                "001abd9ab1237a73",
                "ef2d8c58afbd985f",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "42731e6eb062d973",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "batch_number",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 580,
        "wires": [
            [
                "c1160ebe3a0bbc9a",
                "aea49973c4d684b0",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "3e1d7e66f01a90a1",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "customer_id",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 760,
        "wires": [
            [
                "a71ab506d555ec48",
                "1e7afb85114b45aa",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "fde9d49d065b53d2",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1070,
        "y": 320,
        "wires": [
            [
                "a342515af8a94099"
            ]
        ]
    },
    {
        "id": "001abd9ab1237a73",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1130,
        "y": 500,
        "wires": [
            [
                "f204d0e28ce1b4dd"
            ]
        ]
    },
    {
        "id": "c1160ebe3a0bbc9a",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1150,
        "y": 680,
        "wires": [
            [
                "715fdcb5db67507d"
            ]
        ]
    },
    {
        "id": "a71ab506d555ec48",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1150,
        "y": 840,
        "wires": [
            [
                "2b336c137936beb2"
            ]
        ]
    },
    {
        "id": "4e8f33bf039130c7",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "volume insert",
        "func": "var query = \"INSERT INTO barcode(volume) VALUES (\" + (msg.payload) + \")\";\n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 260,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "ef2d8c58afbd985f",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "production_date insert",
        "func": "var query = \"INSERT INTO barcode(production_date) VALUES (\" + (msg.payload) + \")\" ; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1120,
        "y": 420,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "aea49973c4d684b0",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "batch number insert",
        "func": "var query = \"INSERT INTO barcode(batch_number) VALUES (\" + (msg.payload) + \");\" ;2 \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1120,
        "y": 580,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "1e7afb85114b45aa",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "customer id insert",
        "func": "var query = \"INSERT INTO barcode(customer_id) VALUES (\" + (msg.payload) + \")\" ;2 \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1090,
        "y": 760,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "a342515af8a94099",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function volume",
        "func": "var query = \"SELECT `volume` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1300,
        "y": 340,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "f204d0e28ce1b4dd",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Dashboard Production date",
        "func": "var query = \"SELECT `production_date` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1360,
        "y": 480,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "715fdcb5db67507d",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function batch number",
        "func": "var query = \"SELECT `batch_number` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1420,
        "y": 680,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "2b336c137936beb2",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function customer id",
        "func": "var query = \"SELECT `customer_id` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1400,
        "y": 860,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "26276f65f62a9122",
        "type": "debug",
        "z": "65f1b08076c1fc17",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1670,
        "y": 260,
        "wires": []
    },
    {
        "id": "a9dfb1688f187c8f",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1470,
        "y": 260,
        "wires": [
            [
                "26276f65f62a9122"
            ]
        ]
    },
    {
        "id": "cf8c7775b4dd9199",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1730,
        "y": 480,
        "wires": [
            [
                "ea7558204b815481",
                "404c5a7c1f90fc38"
            ]
        ]
    },
    {
        "id": "a90a8daa731feceb",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 530,
        "y": 60,
        "wires": [
            [
                "0bc67f2dc294819e"
            ]
        ]
    },
    {
        "id": "0bc67f2dc294819e",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "",
        "func": "\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 700,
        "y": 60,
        "wires": [
            [
                "bc8eec020307c679"
            ]
        ]
    },
    {
        "id": "bdf21c90d7e888e0",
        "type": "s7 endpoint",
        "transport": "iso-on-tcp",
        "address": "192.168.1.100",
        "port": "102",
        "rack": "0",
        "slot": "1",
        "localtsaphi": "01",
        "localtsaplo": "00",
        "remotetsaphi": "01",
        "remotetsaplo": "00",
        "connmode": "rack-slot",
        "adapter": "",
        "busaddr": "2",
        "cycletime": "1000",
        "timeout": "2000",
        "name": "PLC1",
        "vartable": [
            {
                "addr": "DB7,INT4",
                "name": "Counter_Up"
            },
            {
                "addr": "DB8,INT4",
                "name": "Counter_Down"
            },
            {
                "addr": "DB1,X0.4",
                "name": "Reset"
            },
            {
                "addr": "DB3,INT4",
                "name": "Counter_Right"
            },
            {
                "addr": "DB1,X0.0",
                "name": "Up"
            },
            {
                "addr": "DB1,X0.1",
                "name": "Down"
            },
            {
                "addr": "DB1,X0.2",
                "name": "Right"
            },
            {
                "addr": "DB1,X0.3",
                "name": "Left"
            },
            {
                "addr": "DB1,X0.5",
                "name": "Start"
            },
            {
                "addr": "DB1,X0.6",
                "name": "Stop"
            },
            {
                "addr": "DB1,X0.7",
                "name": "Stop Service"
            },
            {
                "addr": "DB2,S1280.256",
                "name": "Fastener_Type"
            },
            {
                "addr": "DB2,S1536.10",
                "name": "volume"
            },
            {
                "addr": "DB2,S1792.10",
                "name": "production_date"
            },
            {
                "addr": "DB2,S2048.10",
                "name": "batch_number"
            },
            {
                "addr": "DB2,S2304.10",
                "name": "customer_id"
            },
            {
                "addr": "DB6,INT4",
                "name": "Counter_Left"
            }
        ]
    },
    {
        "id": "91ed457ccb906798",
        "type": "MySQLdatabase",
        "name": "",
        "host": "127.0.0.1",
        "port": "3306",
        "db": "2D_Barcode",
        "tz": "",
        "charset": "UTF8"
    },
    {
        "id": "d97ce9c1f9cd1075",
        "type": "ui_group",
        "name": "2D Barcode",
        "tab": "fb5a62bd6e3e67fd",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "fb5a62bd6e3e67fd",
        "type": "ui_tab",
        "name": "Barcode",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 10:53 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/18 "2022-05-31T10:53:00Z")

</div>

For volume input node:

```auto
[
    {
        "id": "65f1b08076c1fc17",
        "type": "tab",
        "label": "2D_Barcode",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "7068f5728a61cb0c",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "Fastener_Type",
        "diff": true,
        "name": "",
        "x": 320,
        "y": 140,
        "wires": [
            [
                "1c267ac2c8ca52e0",
                "39dcfe77ea772eb6",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "39dcfe77ea772eb6",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Fastener Insert",
        "func": "//m = msg.payload\n//fastener = m.Fastener_Type\n//msg.payload=['RND0508A03A'];\nmsg.topic = \"INSERT INTO barcode(fastener_type) VALUES (\" + (msg.payload) + \");\"; \n\n\n//msg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1080,
        "y": 140,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "bc8eec020307c679",
        "type": "mysql",
        "z": "65f1b08076c1fc17",
        "mydb": "91ed457ccb906798",
        "name": "",
        "x": 850,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "1c267ac2c8ca52e0",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1070,
        "y": 200,
        "wires": [
            [
                "696a42d3469ec68b"
            ]
        ]
    },
    {
        "id": "696a42d3469ec68b",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function Fastener",
        "func": "var query = \"SELECT `fastener_type` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1350,
        "y": 80,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "f47a27fa3f488eac",
        "type": "mysql",
        "z": "65f1b08076c1fc17",
        "mydb": "91ed457ccb906798",
        "name": "",
        "x": 1590,
        "y": 340,
        "wires": [
            [
                "cf8c7775b4dd9199"
            ]
        ]
    },
    {
        "id": "404c5a7c1f90fc38",
        "type": "debug",
        "z": "65f1b08076c1fc17",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1790,
        "y": 720,
        "wires": []
    },
    {
        "id": "ea7558204b815481",
        "type": "ui_template",
        "z": "65f1b08076c1fc17",
        "group": "d97ce9c1f9cd1075",
        "name": "",
        "order": 1,
        "width": "6",
        "height": "8",
        "format": "<style>\ntable {\n text-align: center;\n margin: 50 auto;\n}\ntbody td{\n padding: 25px;\n background-color: rgb(230,254,255);\n}\nthead th{\n padding: 25px;\n background-color: rgb(69,69,69);\n color:#fff;\n border: rgb(36,149,255);\n}\n</style>\n\n<div>\n <table>\n <thead>\n <tr>\n <th>Fastener Type</th> \n <th>Volume</th> \n <th>Production Date</th> \n <th>Batch Number</th> \n <th>Customer Id</th> \n </tr>\n </thead>\n <tbody>\n <tr>\n <td>{{msg.payload[0].fastener_type}}</td> \n <td>{{msg.payload[0].batch_number}}</td>\n <td>{{msg.payload[0].customer_id}}</td>\n <td>{{msg.payload[0].production_date}}</td> \n <td>{{msg.payload[0].volume}}</td> \n </tr>\n <tr>\n <td>{{msg.payload[1].fastener_type}}</td> \n <td>{{msg.payload[1].volume}}</td> \n <td>{{msg.payload[1].production_date}}</td> \n <td>{{msg.payload[1].batch_number}}</td>\n <td>{{msg.payload[1].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[2].fastener_type}}</td> \n <td>{{msg.payload[2].volume}}</td> \n <td>{{msg.payload[2].production_date}}</td> \n <td>{{msg.payload[2].batch_number}}</td>\n <td>{{msg.payload[2].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[3].fastener_type}}</td> \n <td>{{msg.payload[3].volume}}</td> \n <td>{{msg.payload[3].production_date}}</td> \n <td>{{msg.payload[3].batch_number}}</td>\n <td>{{msg.payload[3].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[4].fastener_type}}</td> \n <td>{{msg.payload[4].volume}}</td> \n <td>{{msg.payload[4].production_date}}</td> \n <td>{{msg.payload[4].batch_number}}</td>\n <td>{{msg.payload[4].customer_id}}</td>\n </tr>\n </tbody>\n </table>\n</div>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 1860,
        "y": 640,
        "wires": [
            []
        ]
    },
    {
        "id": "a368340a154d3bea",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "volume",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 240,
        "wires": [
            [
                "fde9d49d065b53d2",
                "4e8f33bf039130c7",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "77d23295fbd0a7cd",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "production_date",
        "diff": true,
        "name": "",
        "x": 340,
        "y": 420,
        "wires": [
            [
                "001abd9ab1237a73",
                "ef2d8c58afbd985f",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "42731e6eb062d973",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "batch_number",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 580,
        "wires": [
            [
                "c1160ebe3a0bbc9a",
                "aea49973c4d684b0",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "3e1d7e66f01a90a1",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "customer_id",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 760,
        "wires": [
            [
                "a71ab506d555ec48",
                "1e7afb85114b45aa",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "fde9d49d065b53d2",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1070,
        "y": 320,
        "wires": [
            [
                "a342515af8a94099"
            ]
        ]
    },
    {
        "id": "001abd9ab1237a73",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1130,
        "y": 500,
        "wires": [
            [
                "f204d0e28ce1b4dd"
            ]
        ]
    },
    {
        "id": "c1160ebe3a0bbc9a",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1150,
        "y": 680,
        "wires": [
            [
                "715fdcb5db67507d"
            ]
        ]
    },
    {
        "id": "a71ab506d555ec48",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1150,
        "y": 840,
        "wires": [
            [
                "2b336c137936beb2"
            ]
        ]
    },
    {
        "id": "4e8f33bf039130c7",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "volume insert",
        "func": "var query = \"INSERT INTO barcode(volume) VALUES (\" + (msg.payload) + \")\";\n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 260,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "ef2d8c58afbd985f",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "production_date insert",
        "func": "var query = \"INSERT INTO barcode(production_date) VALUES (\" + (msg.payload) + \")\" ; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1120,
        "y": 420,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "aea49973c4d684b0",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "batch number insert",
        "func": "var query = \"INSERT INTO barcode(batch_number) VALUES (\" + (msg.payload) + \");\" ;2 \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1120,
        "y": 580,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "1e7afb85114b45aa",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "customer id insert",
        "func": "var query = \"INSERT INTO barcode(customer_id) VALUES (\" + (msg.payload) + \")\" ;2 \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1090,
        "y": 760,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "a342515af8a94099",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function volume",
        "func": "var query = \"SELECT `volume` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1300,
        "y": 340,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "f204d0e28ce1b4dd",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Dashboard Production date",
        "func": "var query = \"SELECT `production_date` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1360,
        "y": 480,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "715fdcb5db67507d",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function batch number",
        "func": "var query = \"SELECT `batch_number` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1420,
        "y": 680,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "2b336c137936beb2",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function customer id",
        "func": "var query = \"SELECT `customer_id` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1400,
        "y": 860,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "26276f65f62a9122",
        "type": "debug",
        "z": "65f1b08076c1fc17",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1670,
        "y": 260,
        "wires": []
    },
    {
        "id": "a9dfb1688f187c8f",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1470,
        "y": 260,
        "wires": [
            [
                "26276f65f62a9122"
            ]
        ]
    },
    {
        "id": "cf8c7775b4dd9199",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1730,
        "y": 480,
        "wires": [
            [
                "ea7558204b815481",
                "404c5a7c1f90fc38"
            ]
        ]
    },
    {
        "id": "a90a8daa731feceb",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 530,
        "y": 60,
        "wires": [
            [
                "0bc67f2dc294819e"
            ]
        ]
    },
    {
        "id": "0bc67f2dc294819e",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "",
        "func": "\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 700,
        "y": 60,
        "wires": [
            [
                "bc8eec020307c679"
            ]
        ]
    },
    {
        "id": "bdf21c90d7e888e0",
        "type": "s7 endpoint",
        "transport": "iso-on-tcp",
        "address": "192.168.1.100",
        "port": "102",
        "rack": "0",
        "slot": "1",
        "localtsaphi": "01",
        "localtsaplo": "00",
        "remotetsaphi": "01",
        "remotetsaplo": "00",
        "connmode": "rack-slot",
        "adapter": "",
        "busaddr": "2",
        "cycletime": "1000",
        "timeout": "2000",
        "name": "PLC1",
        "vartable": [
            {
                "addr": "DB7,INT4",
                "name": "Counter_Up"
            },
            {
                "addr": "DB8,INT4",
                "name": "Counter_Down"
            },
            {
                "addr": "DB1,X0.4",
                "name": "Reset"
            },
            {
                "addr": "DB3,INT4",
                "name": "Counter_Right"
            },
            {
                "addr": "DB1,X0.0",
                "name": "Up"
            },
            {
                "addr": "DB1,X0.1",
                "name": "Down"
            },
            {
                "addr": "DB1,X0.2",
                "name": "Right"
            },
            {
                "addr": "DB1,X0.3",
                "name": "Left"
            },
            {
                "addr": "DB1,X0.5",
                "name": "Start"
            },
            {
                "addr": "DB1,X0.6",
                "name": "Stop"
            },
            {
                "addr": "DB1,X0.7",
                "name": "Stop Service"
            },
            {
                "addr": "DB2,S1280.256",
                "name": "Fastener_Type"
            },
            {
                "addr": "DB2,S1536.10",
                "name": "volume"
            },
            {
                "addr": "DB2,S1792.10",
                "name": "production_date"
            },
            {
                "addr": "DB2,S2048.10",
                "name": "batch_number"
            },
            {
                "addr": "DB2,S2304.10",
                "name": "customer_id"
            },
            {
                "addr": "DB6,INT4",
                "name": "Counter_Left"
            }
        ]
    },
    {
        "id": "91ed457ccb906798",
        "type": "MySQLdatabase",
        "name": "",
        "host": "127.0.0.1",
        "port": "3306",
        "db": "2D_Barcode",
        "tz": "",
        "charset": "UTF8"
    },
    {
        "id": "d97ce9c1f9cd1075",
        "type": "ui_group",
        "name": "2D Barcode",
        "tab": "fb5a62bd6e3e67fd",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "fb5a62bd6e3e67fd",
        "type": "ui_tab",
        "name": "Barcode",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

```

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 10:57 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/19 "2022-05-31T10:57:07Z")

</div>

In node-red the incoming data looks like as following:

 ![Screenshot 2022-05-31 121225 - 6](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/251519cad00661a0183d45282d660bcfb2408f53.jpeg)

I am also quite new in PhpMyAdmin. That's why I am not sure that it field can be NULL and every field must be unique in the database.

---

<div class="post-metadata">

**Author:** ![Show74](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Show74](https://discourse.nodered.org/u/Show74)\
**Post date:** [31 May 2022 11:04 UTC](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052/20 "2022-05-31T11:04:19Z")

</div>

For production\_node node:

```auto
[
    {
        "id": "65f1b08076c1fc17",
        "type": "tab",
        "label": "2D_Barcode",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "7068f5728a61cb0c",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "Fastener_Type",
        "diff": true,
        "name": "",
        "x": 320,
        "y": 140,
        "wires": [
            [
                "1c267ac2c8ca52e0",
                "39dcfe77ea772eb6",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "39dcfe77ea772eb6",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Fastener Insert",
        "func": "//m = msg.payload\n//fastener = m.Fastener_Type\n//msg.payload=['RND0508A03A'];\nmsg.topic = \"INSERT INTO barcode(fastener_type) VALUES (\" + (msg.payload) + \");\"; \n\n\n//msg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1080,
        "y": 140,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "bc8eec020307c679",
        "type": "mysql",
        "z": "65f1b08076c1fc17",
        "mydb": "91ed457ccb906798",
        "name": "",
        "x": 850,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "1c267ac2c8ca52e0",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1070,
        "y": 200,
        "wires": [
            [
                "696a42d3469ec68b"
            ]
        ]
    },
    {
        "id": "696a42d3469ec68b",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function Fastener",
        "func": "var query = \"SELECT `fastener_type` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1350,
        "y": 80,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "f47a27fa3f488eac",
        "type": "mysql",
        "z": "65f1b08076c1fc17",
        "mydb": "91ed457ccb906798",
        "name": "",
        "x": 1590,
        "y": 340,
        "wires": [
            [
                "cf8c7775b4dd9199"
            ]
        ]
    },
    {
        "id": "404c5a7c1f90fc38",
        "type": "debug",
        "z": "65f1b08076c1fc17",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1790,
        "y": 720,
        "wires": []
    },
    {
        "id": "ea7558204b815481",
        "type": "ui_template",
        "z": "65f1b08076c1fc17",
        "group": "d97ce9c1f9cd1075",
        "name": "",
        "order": 1,
        "width": "6",
        "height": "8",
        "format": "<style>\ntable {\n text-align: center;\n margin: 50 auto;\n}\ntbody td{\n padding: 25px;\n background-color: rgb(230,254,255);\n}\nthead th{\n padding: 25px;\n background-color: rgb(69,69,69);\n color:#fff;\n border: rgb(36,149,255);\n}\n</style>\n\n<div>\n <table>\n <thead>\n <tr>\n <th>Fastener Type</th> \n <th>Volume</th> \n <th>Production Date</th> \n <th>Batch Number</th> \n <th>Customer Id</th> \n </tr>\n </thead>\n <tbody>\n <tr>\n <td>{{msg.payload[0].fastener_type}}</td> \n <td>{{msg.payload[0].batch_number}}</td>\n <td>{{msg.payload[0].customer_id}}</td>\n <td>{{msg.payload[0].production_date}}</td> \n <td>{{msg.payload[0].volume}}</td> \n </tr>\n <tr>\n <td>{{msg.payload[1].fastener_type}}</td> \n <td>{{msg.payload[1].volume}}</td> \n <td>{{msg.payload[1].production_date}}</td> \n <td>{{msg.payload[1].batch_number}}</td>\n <td>{{msg.payload[1].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[2].fastener_type}}</td> \n <td>{{msg.payload[2].volume}}</td> \n <td>{{msg.payload[2].production_date}}</td> \n <td>{{msg.payload[2].batch_number}}</td>\n <td>{{msg.payload[2].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[3].fastener_type}}</td> \n <td>{{msg.payload[3].volume}}</td> \n <td>{{msg.payload[3].production_date}}</td> \n <td>{{msg.payload[3].batch_number}}</td>\n <td>{{msg.payload[3].customer_id}}</td>\n </tr>\n <tr>\n <td>{{msg.payload[4].fastener_type}}</td> \n <td>{{msg.payload[4].volume}}</td> \n <td>{{msg.payload[4].production_date}}</td> \n <td>{{msg.payload[4].batch_number}}</td>\n <td>{{msg.payload[4].customer_id}}</td>\n </tr>\n </tbody>\n </table>\n</div>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "local",
        "className": "",
        "x": 1860,
        "y": 640,
        "wires": [
            []
        ]
    },
    {
        "id": "a368340a154d3bea",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "volume",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 240,
        "wires": [
            [
                "fde9d49d065b53d2",
                "4e8f33bf039130c7",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "77d23295fbd0a7cd",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "production_date",
        "diff": true,
        "name": "",
        "x": 340,
        "y": 420,
        "wires": [
            [
                "001abd9ab1237a73",
                "ef2d8c58afbd985f",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "42731e6eb062d973",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "batch_number",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 580,
        "wires": [
            [
                "c1160ebe3a0bbc9a",
                "aea49973c4d684b0",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "3e1d7e66f01a90a1",
        "type": "s7 in",
        "z": "65f1b08076c1fc17",
        "endpoint": "bdf21c90d7e888e0",
        "mode": "single",
        "variable": "customer_id",
        "diff": true,
        "name": "",
        "x": 330,
        "y": 760,
        "wires": [
            [
                "a71ab506d555ec48",
                "1e7afb85114b45aa",
                "a90a8daa731feceb"
            ]
        ]
    },
    {
        "id": "fde9d49d065b53d2",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1070,
        "y": 320,
        "wires": [
            [
                "a342515af8a94099"
            ]
        ]
    },
    {
        "id": "001abd9ab1237a73",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1130,
        "y": 500,
        "wires": [
            [
                "f204d0e28ce1b4dd"
            ]
        ]
    },
    {
        "id": "c1160ebe3a0bbc9a",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1150,
        "y": 680,
        "wires": [
            [
                "715fdcb5db67507d"
            ]
        ]
    },
    {
        "id": "a71ab506d555ec48",
        "type": "trigger",
        "z": "65f1b08076c1fc17",
        "name": "",
        "op1": "",
        "op2": "",
        "op1type": "pay",
        "op2type": "payl",
        "duration": "10",
        "extend": false,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1150,
        "y": 840,
        "wires": [
            [
                "2b336c137936beb2"
            ]
        ]
    },
    {
        "id": "4e8f33bf039130c7",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "volume insert",
        "func": "var query = \"INSERT INTO barcode(volume) VALUES (\" + (msg.payload) + \")\";\n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1070,
        "y": 260,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "ef2d8c58afbd985f",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "production_date insert",
        "func": "var query = \"INSERT INTO barcode(production_date) VALUES (\" + (msg.payload) + \")\" ; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1120,
        "y": 420,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "aea49973c4d684b0",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "batch number insert",
        "func": "var query = \"INSERT INTO barcode(batch_number) VALUES (\" + (msg.payload) + \");\" ;2 \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1120,
        "y": 580,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "1e7afb85114b45aa",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "customer id insert",
        "func": "var query = \"INSERT INTO barcode(customer_id) VALUES (\" + (msg.payload) + \")\" ;2 \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1090,
        "y": 760,
        "wires": [
            [
                "a9dfb1688f187c8f"
            ]
        ]
    },
    {
        "id": "a342515af8a94099",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function volume",
        "func": "var query = \"SELECT `volume` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1300,
        "y": 340,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "f204d0e28ce1b4dd",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Dashboard Production date",
        "func": "var query = \"SELECT `production_date` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1360,
        "y": 480,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "715fdcb5db67507d",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function batch number",
        "func": "var query = \"SELECT `batch_number` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1420,
        "y": 680,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "2b336c137936beb2",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "Function customer id",
        "func": "var query = \"SELECT `customer_id` FROM `barcode` ORDER BY created_at DESC\"; \n\nmsg.topic = query;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1400,
        "y": 860,
        "wires": [
            [
                "f47a27fa3f488eac"
            ]
        ]
    },
    {
        "id": "26276f65f62a9122",
        "type": "debug",
        "z": "65f1b08076c1fc17",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1670,
        "y": 260,
        "wires": []
    },
    {
        "id": "a9dfb1688f187c8f",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1470,
        "y": 260,
        "wires": [
            [
                "26276f65f62a9122"
            ]
        ]
    },
    {
        "id": "cf8c7775b4dd9199",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1730,
        "y": 480,
        "wires": [
            [
                "ea7558204b815481",
                "404c5a7c1f90fc38"
            ]
        ]
    },
    {
        "id": "a90a8daa731feceb",
        "type": "join",
        "z": "65f1b08076c1fc17",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "1",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 530,
        "y": 60,
        "wires": [
            [
                "0bc67f2dc294819e"
            ]
        ]
    },
    {
        "id": "0bc67f2dc294819e",
        "type": "function",
        "z": "65f1b08076c1fc17",
        "name": "",
        "func": "\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 700,
        "y": 60,
        "wires": [
            [
                "bc8eec020307c679"
            ]
        ]
    },
    {
        "id": "bdf21c90d7e888e0",
        "type": "s7 endpoint",
        "transport": "iso-on-tcp",
        "address": "192.168.1.100",
        "port": "102",
        "rack": "0",
        "slot": "1",
        "localtsaphi": "01",
        "localtsaplo": "00",
        "remotetsaphi": "01",
        "remotetsaplo": "00",
        "connmode": "rack-slot",
        "adapter": "",
        "busaddr": "2",
        "cycletime": "1000",
        "timeout": "2000",
        "name": "PLC1",
        "vartable": [
            {
                "addr": "DB7,INT4",
                "name": "Counter_Up"
            },
            {
                "addr": "DB8,INT4",
                "name": "Counter_Down"
            },
            {
                "addr": "DB1,X0.4",
                "name": "Reset"
            },
            {
                "addr": "DB3,INT4",
                "name": "Counter_Right"
            },
            {
                "addr": "DB1,X0.0",
                "name": "Up"
            },
            {
                "addr": "DB1,X0.1",
                "name": "Down"
            },
            {
                "addr": "DB1,X0.2",
                "name": "Right"
            },
            {
                "addr": "DB1,X0.3",
                "name": "Left"
            },
            {
                "addr": "DB1,X0.5",
                "name": "Start"
            },
            {
                "addr": "DB1,X0.6",
                "name": "Stop"
            },
            {
                "addr": "DB1,X0.7",
                "name": "Stop Service"
            },
            {
                "addr": "DB2,S1280.256",
                "name": "Fastener_Type"
            },
            {
                "addr": "DB2,S1536.10",
                "name": "volume"
            },
            {
                "addr": "DB2,S1792.10",
                "name": "production_date"
            },
            {
                "addr": "DB2,S2048.10",
                "name": "batch_number"
            },
            {
                "addr": "DB2,S2304.10",
                "name": "customer_id"
            },
            {
                "addr": "DB6,INT4",
                "name": "Counter_Left"
            }
        ]
    },
    {
        "id": "91ed457ccb906798",
        "type": "MySQLdatabase",
        "name": "",
        "host": "127.0.0.1",
        "port": "3306",
        "db": "2D_Barcode",
        "tz": "",
        "charset": "UTF8"
    },
    {
        "id": "d97ce9c1f9cd1075",
        "type": "ui_group",
        "name": "2D Barcode",
        "tab": "fb5a62bd6e3e67fd",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "fb5a62bd6e3e67fd",
        "type": "ui_tab",
        "name": "Barcode",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

```

[Next page](https://discourse.nodered.org/t/error-er-bad-field-error-unknown-column-rnd0508a03a-in-field-list/63052.md?page=2)
