DBPARTITIONNUM

Click to skip syntax diagram
Read syntax diagramSkip visual syntax diagram>>-DBPARTITIONNUM--(--table-designator--)----------------------><
 

The DBPARTITIONNUM function returns the node number (database partition number) of a row. If the argument identifies a non-distributed table, the value 0 is returned.42 For more information about nodes and node numbers, see the DB2(R) Multisystem book.

table-designator
The argument must be a table designator of the subselect. For more information about table designators, see Table designators.

In SQL naming, the table name may be qualified. In system naming, the table name cannot be qualified.

If the argument identifies a view, common table expression, or derived table, the function returns the node number of its base table. If the argument identifies a view, common table expression, or derived table derived from more than one base table, the function returns the node number of the first table in the outer subselect of the view, common table expression, or derived table.

The argument must not identify a view, common table expression, or derived table whose outer subselect includes an aggregate function, a GROUP BY clause, a HAVING clause, a UNION clause, an INTERSECT clause, or DISTINCT clause. If the subselect contains a GROUP BY or HAVING clause, the DBPARTITIONNUM function can only be specified in the WHERE clause or as an operand of an aggregate function. If the argument is a correlation name, the correlation name must not identify a correlated reference.

The data type of the result is a large integer. The result can be null.

Note

Syntax alternatives: NODENUMBER is a synonym for DBPARTITIONNUM.

Example


42.
If the argument identifies a DDS created logical file that is based on more than one physical file member, DBPARTITIONNUM will not return 0, but instead will return the underlying physical file member number.