Hi All I have a node program where I am trying to insert a byte array to database . My code goes like this
const query = 'INSERT INTO spreaddata.workbook (user_email,workbook_data) VALUES(?,?) ';
sql.query(query, [jsonData.userEmail, jsonData.workbook_data]);
Where jsonData.workbook_data is byte array
But I am getting below error when I execute the query
code: 'ER_WRONG_VALUE_COUNT_ON_ROW',
errno: 1136,
sqlState: '21S01',
sqlMessage: "Column count doesn't match value count at row 1",
sql: "INSERT INTO spreaddata.workbook (user_email,workbook_data) VALUES('[email protected]',80, 75, 3, 4)
For some reason instead of including passed array as [80,75,3,4] it is placing extracted data 80,75,3,4 in the query
What is the problem here
2
Answers
You are passing more data that columns exist.