Start of changeHASH_VALUESEnd of change

The Start of changeHASH_VALUESEnd of change function returns the partition number of a set of values.

Read syntax diagramSkip visual syntax diagram HASH_VALUES ( ,expression)

Also see HASHED_VALUE. For more information about partition numbers, see the DB2® Multisystem topic collection.

expression
An expression that returns a value of any built-in data type except date, time, timestamp, floating-point, XML, or DataLink values.

The result of the function is a large integer with a value between 0 and 1023.

If any of the arguments are null, the result is zero. The result cannot be null.

Example

  • Use the Start of changeHASH_VALUESEnd of change function to determine what the partitions would be if the partitioning key was composed of EMPNO and LASTNAME. This query returns the partition number for every row in EMPLOYEE.
      SELECT HASH_VALUES(EMPNO, LASTNAME)
        FROM EMPLOYEE