sequence()

Combines two or more expressions to be evaluated in order.

Syntax

sequence ( expression [, ...] )

Parameters

expression

An expression of any data type. The last expression in the sequence determines the type and value for the entire sequence.

Usage

Combines two or more expressions to be evaluated in order. The type and value of the expression is the type and value of the last expression.

Sequencing is useful in a projection list to perform several simple instructions in the context of evaluating a projection column value without having to write a SPLASH UDF.

Example

This example computes the maximum price seen so far, assigns it to the maxPrice variable, and returns the product of the maximum price and number of shares.

sequence (
        maxPrice := case when maxPrice < 
inRec.Price then inRec.Price else maxPrice end; maxPrice*inRec.Shares
)