1
我的桌子上有一個clob列。我使用oracledb驅動程序從我的快車應用程序連接到數據庫。我想打印出這個clob。這是我的代碼:Clob在快速應用程序中未正確打印
router.get('/:task_name', function (req,res) {
"use strict";
oracledb.getConnection(connAttrs.database, function (err, connection) {
if (err) {
// Error connecting to DB
res.set('Content-Type', 'application/json');
res.status(500).send(JSON.stringify({
status: 500,
message: "Error connecting to DB",
detailed_message: err.message
}));
return;
}
connection.execute("select solution from solvedtasks s join tasks t on t.TASK_ID = s.TASK_ID WHERE task_name= :task_name", [req.params.task_name],{
outFormat: oracledb.OBJECT //resultSet:true,
}, function (err, result) {
if (err) {
res.set('Content-Type', 'application/json');
res.status(500).send(JSON.stringify({
status: 500,
message: "Error getting the user profile",
detailed_message: err.message
}));
} else {
res.contentType('application/json').status(200);
res.send(JSON.stringify(result.rows[0]));
console.log(result.rows[0]);
// fetchRowsFromRS(connection,res,result.resultSet,10);
}
// Release the connection
connection.release(
function (err) {
if (err) {
console.error(err.message);
} else {
console.log("GET /SolvedTasks : Connection released");
}
});
});
});
});
而不是打印從我的數據庫的CLOB我得到的東西看起來像吊射元數據。有其他人遇到過這個問題嗎?這裏是我的輸出截圖: