How to use the oracledb.OUT_FORMAT_ARRAY 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 / connection.js View on Github external
it('1.1.2 ARRAY format explicitly', function(done) {
      connection.should.be.ok();
      connection.execute(
        query, {id: 20}, {outFormat: oracledb.OUT_FORMAT_ARRAY},
        function(err, result){
          should.not.exist(err);
          (result.rows).should.eql([[ 20, 'Marketing' ]]);
          done();
        }
      );
    });
github oracle / node-oracledb / test / fetchRowidAsString.js View on Github external
it('106.3.8 fetchInfo, resultSet = true', function(done) {
      var option_rs = {
        resultSet: true,
        outFormat: oracledb.OUT_FORMAT_ARRAY,
        fetchInfo: { "CONTENT": { type: oracledb.STRING } }
      };
      test2(option_rs, false, done);
    });
  });
github oracle / node-oracledb / test / properties.js View on Github external
it('58.1.12 outFormat', function() {
      var t = oracledb.outFormat;
      oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT;

      t.should.eql(oracledb.OUT_FORMAT_ARRAY);
      (oracledb.outFormat).should.not.eql(defaultValues.outFormat);
    });
github oracle / node-oracledb / test / connection.js View on Github external
it('1.1.1 ARRAY format by default', function(done) {
      var defaultFormat = oracledb.outFormat;
      defaultFormat.should.be.exactly(oracledb.OUT_FORMAT_ARRAY);

      connection.should.be.ok();
      connection.execute(query, [40], function(err, result){
        should.not.exist(err);
        (result.rows).should.eql([[ 40, 'Human Resources' ]]);
        done();
      });
    });
github oracle / node-oracledb / test / fetchUrowidAsString_indexed.js View on Github external
it('117.6.5 resultSet = true', function(done) {
      var option_rs = {
        resultSet: true,
        outFormat: oracledb.OUT_FORMAT_ARRAY
      };
      test1(option_rs, false, true, done);
    });
github oracle / node-oracledb / test / fetchUrowidAsString.js View on Github external
it('116.6.8 resultSet = true', function(done) {
      var option_rs = {
        resultSet: true,
        outFormat: oracledb.OUT_FORMAT_ARRAY,
      };
      test2(option_rs, false, false, done);
    });
github oracle / node-oracledb / test / fetchClobAsString1.js View on Github external
function(cb) {
          connection.execute(
            "SELECT ID, C AS C1, C AS C2 from nodb_clob1 WHERE ID = " + id,
            { },
            { outFormat : oracledb.OUT_FORMAT_ARRAY },
            function(err, result) {
              should.not.exist(err);
              var resultVal = result.rows[0][1];
              compareClientFetchResult(err, resultVal, specialStr, content, contentLength);
              resultVal = result.rows[0][2];
              compareClientFetchResult(err, resultVal, specialStr, content, contentLength);
              cb();
            }
          );
        }
      ], done);
github oracle / node-oracledb / test / fetchBlobAsBuffer2.js View on Github external
function(cb) {
          connection.execute(
            "SELECT ID, B from nodb_blob1 WHERE id = " + id_1 + " or id = " +id_2,
            { },
            {
              outFormat : oracledb.OUT_FORMAT_ARRAY,
              fetchInfo : { B : { type : oracledb.BUFFER } }
            },
            function(err, result) {
              should.not.exist(err);
              result.rows.length.should.eql(2);
              var resultVal = result.rows[0][1];
              compareClientFetchResult(err, resultVal, specialStr_1, content_1, contentLength_1);
              resultVal = result.rows[1][1];
              compareClientFetchResult(err, resultVal, specialStr_2, content_2, contentLength_2);
              oracledb.maxRows = maxRowsBak;
              cb();
            }
          );
        }
      ], done);
github oracle / node-oracledb / test / fetchRowidAsString.js View on Github external
describe('106.3 works with fetchInfo and outFormat = ARRAY', function() {
    var maxRowBak = oracledb.maxRows;
    var option = {
      outFormat: oracledb.OUT_FORMAT_ARRAY,
      fetchInfo: { "CONTENT": { type: oracledb.STRING } }
    };
    before(function(done) {
      async.series([
        function makeTable(callback) {
          connection.execute(
            proc_create_table,
            function(err) {
              should.not.exist(err);
              callback();
            });
        },
        function insertRow(callback) {
          insertData(connection, tableName, callback);
        },
        function fillRowid(callback) {
github mickeypearce / oradew-vscode / src / common / db.js View on Github external
const getObjectDdl = (
  connection,
  getFunctionName,
  { owner, objectName, objectType1 }
) => {
  oracledb.outFormat = oracledb.OUT_FORMAT_ARRAY;
  return connection
    .execute(
      `select ${getFunctionName}(upper(:objectType1), upper(:objectName), upper(:owner)) from dual`,
      {
        owner,
        objectName,
        objectType1
      }
    )
    .then(result => result.rows[0][0]);
};