Aggregate functions

Module documentation and detailed description for aggregate functions

Function/Subroutine documentation

  • subroutine nzaeGetNextAggregation(handle)

    Gets the next aggregation state.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

  • subroutine nzaeGetNumberOfStateColumns(handle, result)

    Gets the next aggregation state.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • result

        (integer) The number of columns in the state.

  • subroutine nzaeGetStateBoolean(handle, columnIndex, result, isNull)

    Gets the state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The state.

      • isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

  • subroutine nzaeGetInputStateBoolean(handle, columnIndex, result, isNull)

    Gets the input state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The state.

      • isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeGetStateDouble(handle, columnIndex, result, isNull)

    Gets the state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (real*8) The state.

      • isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

  • subroutine nzaeGetInputStateDouble(handle, columnIndex, result, isNull)

    Gets the input state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (real*8) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeGetStateFloat(handle, columnIndex, result, isNull)

    Gets the state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (real) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

  • subroutine nzaeGetInputStateFloat(handle, columnIndex, result, isNull)

    Gets the input state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (real) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeGetStateInt8(handle, columnIndex, result, isNull)

    Gets the state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (real) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

  • subroutine nzaeGetInputStateInt8(handle, columnIndex, result, isNull)

    Gets the input state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeGetStateInt16(handle, columnIndex, result, isNull)

    Gets the state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

  • subroutine nzaeGetInputStateInt16(handle, columnIndex, result, isNull)

    Gets the input state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeGetStateInt32(handle, columnIndex, result, isNull)

    Gets the state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

  • subroutine nzaeGetInputStateInt32(handle, columnIndex, result, isNull)

    Gets the input state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeGetStateString(handle, columnIndex, result, isNull)

    Gets the state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (character*) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

  • subroutine nzaeGetInputStateString(handle, columnIndex, result, isNull)

    Gets the input state value at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (character*) The state.

        isNull

        (integer) The value is 1 if the value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeGetStateScale(handle, columnIndex, result)

    Gets the scale of the state at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        ((integer) The scale of the state field.

  • subroutine nzaeGetStateSize(handle, columnIndex, result)

    Gets the size of the state at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The size of the state field.

  • subroutine nzaeGetStateType(handle, columnIndex, result)

    Gets the type of the state at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • result

        (integer) The type of the state field.

  • subroutine nzaeIsAggDone(handle, isDone)

    Determines if the aggregation is done.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • isDone

        (integer) The value is 1 if the aggregation is done; 0 otherwise.

  • subroutine nzaeIsAggError(handle, isError)

    Determines if the aggregation had an error.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • isError

        (integer) The value is 1 if the aggregation had an error; 0 otherwise.

  • subroutine nzaeIsAggStateAccumulate(handle, isAccumulate)

    Determines if the aggregation state is "accumulate".

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • isAccumulate

        (integer) The value is 1 if the aggregation state is "accumulate"; 0 otherwise.

  • subroutine nzaeIsAggStateInitializeState(handle, isInitializeState)

    Determines if the aggregation state is "initialize-state".

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • isInitializeState

        (integer) The value is 1 if the aggregation state is "initialize-state"; 0 otherwise.

  • subroutine nzaeIsAggStateAccumulate(handle, isFinalResult)

    Determines if the aggregation state is "final-result".

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • isFinalResult

        (integer) The value is 1 if the aggregation state is "final-result"; 0 otherwise..

  • ssubroutine nzaeIsAggStateMerge(handle, isMerge)

    Determines if the aggregation state is "merge".

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • isMerge

        (integer) The value is 1 if the aggregation state is "merge"; 0 otherwise.

  • subroutine nzaeIsInputStateNull(handle, columnIndex, isNull)

    Determines if the input state value is NULL at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • isNull

        (integer) The value is 1 if the input state value is NULL; 0 otherwise.

    This function is only valid during the "merge" and "final-result" aggregation process state. Calls to this function at any other time sends a user error.

  • subroutine nzaeIsStateNull(handle, columnIndex, isNull)

    Determines if the state value is NULL at the specified index.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index.

      • isNull

        (integer) The value is 1 if the state value is NULL; 0 otherwise.

  • subroutine nzaeSaveAggregateResult(handle)

    Saves the current aggregate result.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

    After setting a state or an output result, before calling nzaeGetNextAggregation, this function must be called, otherwise the result is not be sent to the Netezza software.

  • subroutine nzaeSetAggregateBoolean(handle, columnIndex, value)

    Sets a state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

      • value

        (integer) The aggregate value to set.

  • subroutine nzaeSetAggregateDouble(handle, columnIndex, value)

    Sets a state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

      • value

        (real*8) The aggregate value to set.

  • subroutine nzaeSetAggregateFloat(handle, columnIndex, value)

    Sets a state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

      • value

        (integer) The aggregate value to set.

  • subroutine nzaeSetAggregateInt8(handle, columnIndex, value)

    Sets a state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

      • value

        (integer) The aggregate value to set.

  • subroutine nzaeSetAggregateInt16(handle, columnIndex, value)

    Sets a state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

      • value

        (integer) The aggregate value to set.

  • subroutine nzaeSetAggregateInt32(handle, columnIndex, value)

    Sets a state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

      • value

        (integer) The aggregate value to set.

  • subroutine nzaeSetAggregateNull(handle, columnIndex)

    Sets a NULL state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

  • subroutine nzaeSetAggregateString(handle, columnIndex, value)

    Sets a state or output value for aggregation.

    • Parameters
      • handle

        (integer) The handle passed to nzaeHandleRequest .

      • columnIndex

        (integer) The column index to set.

      • value

        (character*) The aggregate value to set.