Clob在快速应用程序中没有正确打印

我有一个clob列这张桌子。 我使用oracledb驱动程序从我的快速应用程序连接到数据库。 我想打印出这个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,我得到了一些看起来像lob元数据。 有没有其他人遇到过这个问题? 这里是我的输出的截图: Clob输出

所以我解决了这个问题,我发布了一个答案,以防万一有这个问题。 显然原来的oracledb驱动程序有处理clobs的一些问题。 但是有一个增强其function的库,名为simple-oracledb,非常易于使用和安装: https : //github.com/sagiegurari/simple-oracledb

通过使用connection.query,clobs被正确处理:

  enter code here connection.query('SELECT * FROM departments WHERE manager_id > :id', [110], { splitResults: true, //True to enable to split the results into bulks, each bulk will invoke the provided callback (last callback invocation will have empty results) bulkRowsAmount: 100 //The amount of rows to fetch (for splitting results, that is the max rows that the callback will get for each callback invocation) }, function onResults(error, results) { if (error) { //handle error... } else if (results.length) { //handle next bulk of results } else { //all rows read } });