Sorry for the dumb question, but I’m trying to synch values from a MySQL to a SQL Server. I’m connected to both db and I do run a Query on the MySQL to return the results I want
SELECT *
FROM prestashop_orders
WHERE extracted = 2;
Now I’d like insert some fields from the table to the SQL server, for exemple the value from the field “reference” from the MySQL table “prestashop_orders” to “Your Reference” field from the table Test$TempSalesHeader in the SQL Server.
Have you tried adding an Edit Fields node between the MySQL node and the SQL node to change the field names then using the insert option in the SQL node?
Edit: on the screenshot it shows [‘Your Reference’],[‘Your Reference’] in columns, it was a test, I get the same error with only one [‘Your Reference’]
When I try just ‘Your Reference’ I get ERROR: Invalid column name ‘‘Your Reference’’.
It’s a bit better when I put Your Reference ERROR: Cannot insert the value NULL into column ‘Interface Type’, table ‘NavOpal.dbo.Opal$TempSalesHeader’; column does not allow nulls. INSERT fails.
What happens if you add the Interface Type to your query? It sounds like the Table requires an option for that which isn’t in the data you are sending.
But I did delete the edit part I previously used, and now
UPDATE Opal$TempSalesHeader
SET [Your Reference] = {{ $json.reference }}
WHERE [Source Document No_] = '989962';
It returns this error ERROR: Invalid column name 'GHWPIXTSO'. GHWPIXTSO being the value.
Also, I’m using self-hosted version, maybe that the issue ?
Self-hosted users can switch back to RiotTmpl: set N8N_EXPRESSION_EVALUATOR to tmpl. Refer to Environment variables for more information on configuring self-hosted n8n.
One more question, is it possible to join two or more items into one column ? For example, I’d like to join '{{ $json.firstname}}' and '{{ $json.lastname }}' together so I get “Firstname Lastname” in my Customer column