Мы используем пакет mysql
в Node.Js
для подключения к Aurora DB.
Мы вызываем хранимую процедуру, и иногда мы получаем 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
Мы проверили нашу БД, и существует столбец "requestSystemId". Мы пытались расположить различные операторы 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 {
//.....
}
})
}
})