Rename Field Expression

Hi,

i dont understand how it works to use the insert feature of the mysql part.

now i would like to insert 3 field, but i get these errors:

ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘5733,[email protected]) VALUES (NU’ at line 2

Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VALUES   at PromiseConnection.query (/usr/local/lib/node_modules/n8n/node_modules/mysql2/promise.js:92:22)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/MySql/MySql.node.js:181:50)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:370:47

Have you any idea ?
is so right ?
field1,field2,field3
nd then the fields from n8n ?

Thanks you from Germany,
Stefan

One thing; The SQL Query when i do write it direct with the Execute Query feature.

Hello,

sorry, do honestly not totally understand what you mean.
Here is an example of how an insert works with the Postgres-Node which works exactly the same as the MySQL one does:
https://n8n.io/workflows/1

You have that the data in the flow matches the data in the MySQL table. Meaning if you have in the flow this data:
{
name: “Tim”,
email: “[email protected]
}

So the keys are named “name” and “email” then you would type in the Columns parameter “name,email” and the columns in your MySQL-Table also would have to be named “name” and “email”. If they would be named “name” and “e-mail” you would have to rename the data in the flow first with a RenameKeys-Node (so rename “email” to “e-mail”).

I hope that helps!

Jan, thanks for the answer. I have a problem with the rename function with one field. Have a look here.

I would like to rename the field adress to epost (fieldname in my db). But here is the problem that in the strukture address is many times here.

Thanks,
Stefan

One thing: the yellow ones works fine: But the red ones not. When i execute the button these wherent shows me !

Sorry,#
Stefan

I would like to have the field with the @gmail.

@Stefan Hey for that you gotta use the set node and add an expresión or the function node. Btw could you please create another topic for this since this is not a MySQL question. Thanks.

I will send a example when I have time.

Regards

Ricardo, ok i try it. These tool n8n is so great !

@Stefan glad you liked it. Let us know if you have any other question.

1 Like