このプロシージャは、既存のテーブルの増分値の最大値/最小値を返します。

Parameters

Parameter

Description

tableName

Fully-qualified name of the data table; mandatory

incrementalField

Field to search for the maximum/minimum value in the data table; see below for more detail

incrementalFilter

Data table filter to search for the maximum incremental value, e.g. due to partitioning

incrementalMinimum

If TRUE, requests the minimum value instead of the maximum one from the data table

incrementalAlternateField

Specifies 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

複数のフィールドタイプをサポートするために、極値はオブジェクトとして返されます。呼び出し側でそれぞれのデータ型にキャストされることになっています。

インクリメンタル フィールドが指定されていない場合、プロシージャはデータを返さないため、値の代入は常に NULL 値になることに注意してください:

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

この呼び出し例は 0 を返します。

incrementalFieldを指定する場合は、比較可能な列タイプのみを提出することをお勧めします。これには数値(integer、long、float、double、decimal など)、日付、TIMESTAMP データ型が含まれます。文字列を送信するとエラーになります。