My project is built over Node,Mongo and Oracle.Now client wants to use mssql in the place of oracle with minimum level of code change.I have very limited knowledge with Oracle and Mssql databases.For oracle we used oracledb npm which supports resultset method to retreive the data from oracle.connection.execute( "SELECT employee_id, last_name FROM employees ORDER BY employee_id", [], // no bind variables { resultSet: true }, // return a Result Set. Default is false function(err, result) { if (err) { . . . } fetchOneRowFromRS(connection, result.resultSet); }); }); function fetchOneRowFromRS(connection, resultSet) { resultSet.getRow( // get one row function (err, row) { if (err) { . . . // close the Result Set and release the connection } else if (!row) { // no rows, or no more rows . . . // close the Result Set and release the connection } else { console.log(row); fetchOneRowFromRS(connection, resultSet); // get next row } }); } And I choose the mssql npm for mssql database.I cannot find any method which is equivalent to resultset in OracleDB npm.Please suggest me the right way or the right npm to solve my problem.Thanks in advance
Submitted September 18, 2018 at 04:59PM by karthik_tantam
No comments:
Post a Comment