lib/connection/result/result.js
function createChunks(chunkCfgs,
                      rowset,
                      columns,
                      mapColumnNameToIndices,
                      chunkHeaders,
                      statementParameters,
                      resultVersion,
                      statement,
                      services)
{
  var chunks;
  var startIndex;
  var length;
  var index;
  var chunkCfg;

  // if we don't have any chunks, or if some records were returned inline,
  // fabricate a config object for the first chunk
  chunkCfgs = chunkCfgs || [];
  if (!chunkCfgs || rowset.length > 0)
  {
    chunkCfgs.unshift(
    {
      rowCount: rowset.length,
      url: null,
      rowset: rowset
    });
  }

  chunks = new Array(chunkCfgs.length);

  // loop over the chunk config objects and build Chunk instances out of them
  startIndex = 0;
  length = chunkCfgs.length;
  for (index = 0; index < length; index++)
  {
    chunkCfg = chunkCfgs[index];

    // augment the chunk config object with additional information
    chunkCfg.statement = statement;
    chunkCfg.services = services;
    chunkCfg.startIndex = startIndex;
    chunkCfg.columns = columns;
    chunkCfg.mapColumnNameToIndices = mapColumnNameToIndices;
    chunkCfg.chunkHeaders = chunkHeaders;
    chunkCfg.statementParameters = statementParameters;
    chunkCfg.resultVersion = resultVersion;

    // increment the start index for the next chunk
    startIndex += chunkCfg.rowCount;

    // create a new Chunk from the config object, and add it to the chunks array
    chunks[index] = new Chunk(chunkCfg);
  }

  return chunks;
}
function createChunks(chunkCfgs,
                      rowset,
                      columns,
                      mapColumnNameToIndices,
                      chunkHeaders,
                      statementParameters,
                      resultVersion,
                      statement,
                      services)
{
  var chunks;
  var startIndex;
  var length;
  var index;
  var chunkCfg;

  // if we don't have any chunks, or if some records were returned inline,
  // fabricate a config object for the first chunk
  chunkCfgs = chunkCfgs || [];
  if (!chunkCfgs || rowset.length > 0)
  {
    chunkCfgs.unshift(
    {
      rowCount: rowset.length,
      url: null,
      rowset: rowset
    });
  }

  chunks = new Array(chunkCfgs.length);

  // loop over the chunk config objects and build Chunk instances out of them
  startIndex = 0;
  length = chunkCfgs.length;
  for (index = 0; index < length; index++)
  {
    chunkCfg = chunkCfgs[index];

    // augment the chunk config object with additional information
    chunkCfg.statement = statement;
    chunkCfg.services = services;
    chunkCfg.startIndex = startIndex;
    chunkCfg.columns = columns;
    chunkCfg.mapColumnNameToIndices = mapColumnNameToIndices;
    chunkCfg.chunkHeaders = chunkHeaders;
    chunkCfg.statementParameters = statementParameters;
    chunkCfg.resultVersion = resultVersion;

    // increment the start index for the next chunk
    startIndex += chunkCfg.rowCount;

    // create a new Chunk from the config object, and add it to the chunks array
    chunks[index] = new Chunk(chunkCfg);
  }

  return chunks;
}
function createChunks ( chunkCfgs , rowset , columns , mapColumnNameToIndices , chunkHeaders , statementParameters , resultVersion , statement , services ) { var chunks ; var startIndex ; var length ; var index ; var chunkCfg ; // if we don't have any chunks, or if some records were returned inline, // fabricate a config object for the first chunk chunkCfgs = chunkCfgs || [ ] ; if ( ! chunkCfgs || rowset . length > 0 ) { chunkCfgs . unshift ( { rowCount : rowset . length , url : null , rowset : rowset } ) ; } chunks = new Array ( chunkCfgs . length ) ; // loop over the chunk config objects and build Chunk instances out of them startIndex = 0 ; length = chunkCfgs . length ; for ( index = 0 ; index < length ; index ++ ) { chunkCfg = chunkCfgs [ index ] ; // augment the chunk config object with additional information chunkCfg . statement = statement ; chunkCfg . services = services ; chunkCfg . startIndex = startIndex ; chunkCfg . columns = columns ; chunkCfg . mapColumnNameToIndices = mapColumnNameToIndices ; chunkCfg . chunkHeaders = chunkHeaders ; chunkCfg . statementParameters = statementParameters ; chunkCfg . resultVersion = resultVersion ; // increment the start index for the next chunk startIndex += chunkCfg . rowCount ; // create a new Chunk from the config object, and add it to the chunks array chunks [ index ] = new Chunk ( chunkCfg ) ; } return chunks ; }
Creates an array of Chunk instances from the chunk-related information in the
result response.

@param chunkCfgs
@param rowset
@param columns
@param mapColumnNameToIndices
@param chunkHeaders
@param statementParameters
@param resultVersion
@param statement
@param services

@returns {Chunk}
Creates an array of Chunk instances from the chunk - related information in the result response .