Skip to main content
Skip table of contents

returnExtremeValue

This procedure returns the maximum/minimum incremental value in an existing table.

Parameters

ParameterDescription
tableNameFully-qualified name of the data table; mandatory
incrementalFieldField to search for the maximum/minimum value in the data table; see below for more detail
incrementalFilterData table filter to search for the maximum incremental value, e.g. due to partitioning
incrementalMinimumIf TRUE, requests the minimum value instead of the maximum one from the data table
incrementalAlternateFieldSpecifies the field to return results based on the extreme value of another incremental field (e.g. to return the ID of a record with maximum/minimum timestamp, specify the ID here)

Attributes

Attribute

Type

Description

extremeValue

object

Maximum/minimum incremental value in the data table

The extreme value is returned as an object to support multiple field types. It is supposed to be cast to the respective data type by the caller.

Please note that when the incremental field is not specified, the procedure will return no data, and thus, value assignment will always result in a null value:

SQL
SELECT count(*) FROM UTILS.returnExtremeValue (
    tableName => 'SYS.Tables'
);;

This example call returns 0.

We recommend submitting only comparable column types when specifying incrementalField. These include numbers (integer, long, float, double, decimal, etc., date, and timestamp datatypes). Submitting strings will result in an error.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.