RowBatch

A row batch object contains one or more result set row objects. It is received only by the result set batch filter.

Properties

  • startRowNum (number): the row number in the result set of the first row in this batch.


This object is a collection object, therefore it can be used like any other collection:

let batch = context.packet;

for (let row of batch) {

if (row["first_name"] && row["first_name"] === "Juliet") {

row.last_name += " MODIFIED";

let dup = row.clone();

dup.first_name = "Clone of Juliet";

batch.push(dup.clone());

}

}


Methods

  • push(object row): adds the provided row to the end of the batch

  • splice(int index[, int num]): remove the object at index, or if num is specified, remove num objects starting at index.


When modifying a row batch, for instance by pushing a row, keep in mind that there may be more row batches in the result set, and therefore that the row pushed at the end of the batch may not be at the end of the result set.