Error when entering data in Mysql

Hello everyone, I have a problem which I cannot solve, I am trying to enter some boolean data from the output of a Siemens LOGO8 into a mysql table, simply 1 or 0, but when executing the instruction I get the following error: Error: ER_BAD_FIELD_ERROR: Unknown column 'undefined' in 'field list'

I attach the instruction that I am using, can someone help me?

msg.topic = "INSERT INTO SPTable (STARTD, STOPD, Cnt_STARTD, Cnt_STOPD) VALUES (" + flow.get("Q02") + "," + flow.get("Q05") + "," + flow.get("AM10") + "," + flow.get("AM11") + ")";
return msg;

I attach my table in mysql, the columns are configured to receive a boolean data and so that the columns could be observed, I added a value of 1 directly in mysql

The first column of your DB table is STARTe not STARTD

Put a debug before the mysql node & check the SQL string.

Also, look in the sidebar context tab, look at the values of flow context - do your flow variables have values?

Sorry if I was running multiple tests and attached the wrong image. It is definitely STARTD but it still gives me the error

Then follow Steve's advice.

Or is the table name correct as i see SPTABLE and SPTable, You may need to edit your post so everyone is working from the same page.

Thanks, I did it and I realized that the states of Q02 and Q05 were fine and what was giving me a problem was AM10 and AM11. I used those variables AM10 and AM11 as 2 outputs that registered how many times a motor stops, but the correct blocks that I should have used had to be analog outputs AQ. I changed it and it works. Thanks.

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