Row token

The Row token is sent by the server for every row in a result set, either from a SQL query or a stored procedure call.

The NBCRow packet is exactly the same as the Row packet, it is often used for rows that contain null values (NBC stands for null bitmap compression).

Properties

Additional properties are the values in the row and can be retrieved by their column name, e.g.:

let name = context.packet.first_name;

If the column name contains characters such as spaces, dashes, punctuation, etc... you can use the array notation, e.g. context.packet["My special$column"]. Column names are case-sensitive.

You can also retrieve a column value by its column index:

let name = context.packet[3];


Methods

The ClassificationEntry object

Properties

string sensitivityLabel: the sensitivity label

string informationType: the information type label

int sensitivityRank: the rank for this entry

Examples

Change the value of a column

if (context.packet.country === 'FR') {
    context.packet.balance = 0;
}


Hide columns based on the metadata

Hide the value of all the columns of type varchar:

let pkt = context.packet;

for (let meta of pkt.columnMetadata) {

    if (meta.typeInfo.typeName === "varchar") {

        pkt[meta.columnName] = "<hidden>";

    }

}