How to use the oracledb.maxRows function in oracledb

To help you get started, we’ve selected a few oracledb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oracle / node-oracledb / test / fetchTimestampAsString.js View on Github external
describe('19.3 testing maxRows setttings and queryStream() to fetch as string', function() {
    var tableName = "nodb_timestamp3";
    var inData = assist.TIMESTAMP_TZ_STRINGS_1;
    var defaultLimit = oracledb.maxRows;

    before(function(done) {
      should.strictEqual(defaultLimit, 0);
      assist.setUp4sql(connection, tableName, inData, done);
    });

    after(function(done) {
      oracledb.fetchAsString = [];
      connection.execute(
        "DROP table " + tableName + " PURGE",
        function(err) {
          should.not.exist(err);
          done();
        }
      );
    }); // after
github oracle / node-oracledb / test / fetchBlobAsBuffer2.js View on Github external
it('88.1.13 works with setting oracledb.maxRows > actual number of rows in the table', function(done) {
      var id_1 = insertID++;
      var specialStr_1 = '88.1.13_1';
      var contentLength_1 = 200;
      var strBuf_1 = random.getRandomString(contentLength_1, specialStr_1);
      var content_1 = Buffer.from(strBuf_1, "utf-8");
      var id_2 = insertID++;
      var specialStr_2 = '88.1.13_2';
      var contentLength_2 = 100;
      var strBuf_2 = random.getRandomString(contentLength_2, specialStr_2);
      var content_2 = Buffer.from(strBuf_2, "utf-8");
      var maxRowsBak = oracledb.maxRows;
      oracledb.maxRows = 10;

      async.series([
        function(cb) {
          insertIntoBlobTable1(id_1, content_1, cb);
        },
        function(cb) {
          insertIntoBlobTable1(id_2, content_2, cb);
        },
        function(cb) {
          connection.execute(
            "SELECT ID, B from nodb_blob1 WHERE id = " + id_1 + " or id = " +id_2,
            { },
            {
              fetchInfo : { B : { type : oracledb.BUFFER } }
            },
github oracle / node-oracledb / test / fetchBlobAsBuffer1.js View on Github external
it('87.5.15 works with setting oracledb.maxRows > actual number of rows in the table', function(done) {
      var id_1 = insertID++;
      var specialStr_1 = '87.5.15_1';
      var contentLength_1 = 200;
      var strBuf_1 = random.getRandomString(contentLength_1, specialStr_1);
      var content_1 = Buffer.from(strBuf_1, "utf-8");
      var id_2 = insertID++;
      var specialStr_2 = '87.5.15_2';
      var contentLength_2 = 100;
      var strBuf_2 = random.getRandomString(contentLength_2, specialStr_2);
      var content_2 = Buffer.from(strBuf_2, "utf-8");
      var maxRowsBak = oracledb.maxRows;
      oracledb.maxRows = 10;

      async.series([
        function(cb) {
          insertIntoBlobTable1(id_1, content_1, cb);
        },
        function(cb) {
          insertIntoBlobTable1(id_2, content_2, cb);
        },
        function(cb) {
          var rowNumFetched = 2;
          connection.execute(
            "SELECT ID, B from nodb_blob1 WHERE id = " + id_1 + " or id = " +id_2,
            { },
            {
              outFormat : oracledb.OUT_FORMAT_ARRAY,
              resultSet : true
github oracle / node-oracledb / test / lobResultSet.js View on Github external
it('59.2.3 works with oracledb.maxRows = actual number of rows fetched', function(done) {
      var maxRowsBak = oracledb.maxRows;
      oracledb.maxRows = 3;

      var id_1 = insertID++;
      var id_2 = insertID++;
      var id_3 = insertID++;
      async.series([
        function(callback) {
          streamIntoBlob(id_1, callback);
        },
        function(callback) {
          streamIntoBlob(id_2, callback);
        },
        function(callback) {
          streamIntoBlob(id_3, callback);
        },
        function(callback) {
          connection.execute(
github oracle / node-oracledb / test / properties.js View on Github external
before('save the default values', function() {
      defaultValues.poolMin          = oracledb.poolMin;
      defaultValues.poolMax          = oracledb.poolMax;
      defaultValues.poolIncrement    = oracledb.poolIncrement;
      defaultValues.poolTimeout      = oracledb.poolTimeout;
      defaultValues.maxRows          = oracledb.maxRows;
      defaultValues.fetchArraySize   = oracledb.fetchArraySize;
      defaultValues.autoCommit       = oracledb.autoCommit;
      defaultValues.connectionClass  = oracledb.connectionClass;
      defaultValues.externalAuth     = oracledb.externalAuth;
      defaultValues.fetchAsString    = oracledb.fetchAsString;
      defaultValues.outFormat        = oracledb.outFormat;
      defaultValues.lobPrefetchSize  = oracledb.lobPrefetchSize;
      defaultValues.queueTimeout     = oracledb.queueTimeout;
      defaultValues.stmtCacheSize    = oracledb.stmtCacheSize;
      defaultValues.poolPingInterval = oracledb.poolPingInterval;
      defaultValues.fetchAsBuffer    = oracledb.fetchAsBuffer;
      defaultValues.edition          = oracledb.edition;
      defaultValues.events           = oracledb.events;
    });
github oracle / node-oracledb / test / fetchArraySize2.js View on Github external
describe("149. fetchArraySize2.js", function() {

  var connection = null;
  var default_fetcArraySize = oracledb.fetchArraySize;
  var default_maxRows = oracledb.maxRows;
  var tableName = "nodb_fetchArraySize_149";
  var tableSize = 1000;

  var create_table = "BEGIN \n" +
                     "    DECLARE \n" +
                     "        e_table_missing EXCEPTION; \n" +
                     "        PRAGMA EXCEPTION_INIT(e_table_missing, -00942); \n" +
                     "    BEGIN \n" +
                     "        EXECUTE IMMEDIATE('DROP TABLE " + tableName + " PURGE'); \n" +
                     "    EXCEPTION \n" +
                     "        WHEN e_table_missing \n" +
                     "        THEN NULL; \n" +
                     "    END; \n" +
                     "    EXECUTE IMMEDIATE (' \n" +
                     "        CREATE TABLE " + tableName + " ( \n" +
                     "            id         NUMBER, \n" +
github oracle / node-oracledb / test / fetchUrowidAsString_indexed.js View on Github external
function(err, result) {
            should.not.exist(err);
            rowExpected = (oracledb.maxRows >= 2) ? 2 : oracledb.maxRows;
            if(rsFlag === true) {
              rowExpected = 2;
            }
            should.strictEqual(result.rows.length, rowExpected);
            rowid_1 = result.rows[0][1];
            if(rowExpected === 2) {
              rowid_2 = result.rows[1][1];
            }
            cb();
          }
        );
github oracle / node-oracledb / test / fetchClobAsString2.js View on Github external
function(err, row) {
                  should.not.exist(err);
                  should.strictEqual(row.length, 2);
                  var resultVal = row[0][1];
                  compareClientFetchResult(err, resultVal, specialStr_1, content_1, contentLength_1);
                  resultVal = row[1][1];
                  compareClientFetchResult(err, resultVal, specialStr_2, content_2, contentLength_2);
                  oracledb.maxRows =maxRowsBak;
                  result.resultSet.close(function(err) {
                    should.not.exist(err);
                    cb();
                  });
                }
              );
github oracle / node-oracledb / test / fetchRowidAsString.js View on Github external
function(err, result) {
        should.not.exist(err);
        var rowExpected = (oracledb.maxRows >= numRows) ? numRows : oracledb.maxRows;
        should.strictEqual(result.rows.length, rowExpected);
        callback();
      }
    );
github oracle / node-oracledb / test / fetchArraySize4.js View on Github external
describe("151. fetchArraySize4.js", function() {

  var connection = null;
  var default_fetcArraySize = oracledb.fetchArraySize;
  var default_maxRows = oracledb.maxRows;
  var tableName = "nodb_fetchArraySize_151";
  var tableSize = 1000;

  var create_table = "BEGIN \n" +
                     "    DECLARE \n" +
                     "        e_table_missing EXCEPTION; \n" +
                     "        PRAGMA EXCEPTION_INIT(e_table_missing, -00942); \n" +
                     "    BEGIN \n" +
                     "        EXECUTE IMMEDIATE('DROP TABLE " + tableName + " PURGE'); \n" +
                     "    EXCEPTION \n" +
                     "        WHEN e_table_missing \n" +
                     "        THEN NULL; \n" +
                     "    END; \n" +
                     "    EXECUTE IMMEDIATE (' \n" +
                     "        CREATE TABLE " + tableName + " ( \n" +
                     "            id         NUMBER, \n" +