gpt4 book ai didi

mysql - 错误: ER_BAD_FIELD_ERROR: Unknown column 'claimSystemId' in 'field list'

转载 作者:行者123 更新时间:2023-11-29 17:34:42 31 4
gpt4 key购买 nike

我们在 Node.Js 中使用 mysql 包来连接到 Aurora DB。

我们正在调用存储过程,有时会收到错误:ER_BAD_FIELD_ERROR:“字段列表”中未知的列“claimSystemId”错误。

CREATE DEFINER=`CLIroham`@`%` PROCEDURE `spGetMasterData`(IN documentIdParam bigint)
BEGIN
select stateId AS id,stateName AS name from state;
select countryId AS id, countryName AS name from country;
select statusCode AS id, status AS name from statusMaster where type_of_status = 'Client_Instruction_Status';
select statusCode AS id, status AS name from statusMaster where type_of_status = 'PROGRAM_STATUS';
select personId AS id, firstname AS name from person where employeeType = 'AE' limit 20;
select naicsCodeId AS id, naicsCode as name from naicsMaster limit 20;
select clientId AS id , name AS name from client limit 10;
select doc.revNumber as revNumber ,concat(p.firstname,' ',p.lastname) as createdBy,
doc.lastModifiedDate as lastModifiedDate, doc.revChangesText
from documentHistory as doc JOIN person as p on p.personId=doc.lastModifiedBy
where doc.documentId = documentIdParam
order by revNumber desc;
select claimSystemId As id, Name as name from claimSystem;
END

我们检查了数据库并且“claimSystemId”列是否存在。我们尝试在存储过程中放置​​不同的 select 语句,但每次错误并不频繁并且保持不变。

mysql连接详情如下:

exports.pool = mysql.createPool({
connectionLimit: 100,
host: "###",
user: "##",
password: "##",
port: "3306",
database: "##",
multipleStatements: true
});

DB.pool.getConnection(function (err, connection) {
if (!!err) {
//console.error(err);
res.status(500).send(err);
} else {
connection.query("call spGetMasterData(?)", _documentId, function (error, result) {
if (error) {

connection.release();
var errorResponse = {
"errorMessage" : "Retry"
}
res.send(errorResponse)
return
}
else {
//.....
}
})
}
})

最佳答案

我不是 100% 在这里,但我相信当您传递值时,您需要确保使用 ${value} 截断该值,并且如果该值是您想要的值试图传递的是一个字符串,那么您将需要 '${string_value}' ,它看起来像 '_documentId 可能是,但看起来错误与您的 connection.query(); 一致

关于mysql - 错误: ER_BAD_FIELD_ERROR: Unknown column 'claimSystemId' in 'field list' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50387136/

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