gpt4 book ai didi

mysql - Nodejs 字段列表中的未知列

转载 作者:行者123 更新时间:2023-11-29 16:13:24 25 4
gpt4 key购买 nike

我在nodejs中有以下代码。我正在使用 npm 的 mysql 库,我知道 mysql 数据库中的所有列都是正确的,但我不断收到以下错误:“‘字段列表’中未知列‘s3_id’”,但是当我从 custom_videos 中选择 s3_id 时,我得到了行。我怎样才能有一个存在的未知列?

router.post("/submitCustomVideo", async (req, res, next) => {
try {
const data = {};
const {
s3Id,
name,
renderTime,
duration,
description,
selectedCategories,
selectedKeywords,
customFields
} = req.body;
const VALUES = {
s3_id: s3Id,
name,
duration,
description,
render_time: renderTime,
custom_fields: customFields
};
const updateCustomVideoInfoResult = await database.query(
"call updateCustomVideoInfo(?)",
[VALUES]
);
} catch (error) {
console.log(error);
next(error);
}
});

这是我的存储过程

CREATE DEFINER=`mystuff`@`%` PROCEDURE `updateCustomVideoInfo`(s3_id_param varchar(255), name_param varchar(255), duration_param int, description_param varchar(255), render_time_param int, custom_fields_param json)
BEGIN
UPDATE custom_videos SET name = name_param, duration = duration_param, description = description_param, render_time = render_time_param, custom_fields = custom_fields_param WHERE s3_id = s3_id_param;
END

最佳答案

尝试将列设置为字符串,并检查列的数据类型。

关于mysql - Nodejs 字段列表中的未知列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55050583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com