REDUCE_TO_VECT

This stored procedure reduces specified database matrix objects to a vector object.

Usage

The REDUCE_TO_VECT function has the following syntax:
REDUCE_TO_VECT(inputMatrix,outputVector,expressionPrefix,expressionPostfix,orientation)
Parameters
inputMatrix
The name of the input matrix.
Type: NVARCHAR(ANY)
outputVector
The name of the resulting matrix.
Type: NVARCHAR(ANY)
expressionPrefix
The prefix of the aggregate expression that is used for the reduction. Typically, the prefix is the name of an aggregate function.
Type: NVARCHAR(ANY)
expressionPostfix
The postfix of the aggregate expression that is used for the reduction. Typically, the postfix consists of parameters of an aggregate function.
orientation
The orientation of the resulting vector object and the reduction operation. Values are 'r' for row and 'c' for column.
Returns
BOOLEAN TRUE, if successful.

Details

This stored procedure reduces specified database matrix objects to a vector object by using the specified aggregate expression. A vector object is a database matrix object with a single row or column. The following values of the orientation parameters determine the orientation of the vector object: -'c' means that the aggregation is executed on rows of the input matrix and results in columns. -'r' means that the aggregation is executed on columns of the input matrix and results in rows. The specified aggregate expression uses the following concatenation for the expressionPrefix argument and the expressionPostfix argument: expressionPrefix || "(" || matrix cell value || expressionPostfix || ")" For example, consider the pairs 'AVG','' or 'SQRT(VARIANCE', ')'.

Examples

call nzm..create_random_matrix('REDUCTION_TEST', 1000, 
 1000);
call nzm..reduce_to_vect('REDUCTION_TEST','REDUCTION_TEST_c',
 ' avg','','c');
call nzm..reduce_to_vect('REDUCTION_TEST','REDUCTION_TEST_r',
' SQRT(VARIANCE',')','r');