我们正在使用 mysql
Package Node.Js
连接到极光数据库。
我们正在调用一个存储过程,有时 Error: ER_BAD_FIELD_ERROR: Unknown column 'claimSystemId' in 'field list'
错误。
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 {
//.....
}
})
}
})
1条答案
按热度按时间cs7cruho1#
我不是100%在这里,但我相信,当您传递值时,您需要确保您正在截断值
${value}
如果要传递的值是字符串,则需要'${string_value}'
可能是“\u documentid”,但错误似乎与您的connection.query()有关;