Start of change

pseudo columns

A pseudo column is an identifier that shares the same namespace as columns and variables. After regular name resolution for a column has failed, DB2® attempts to match an unqualified identifier to a pseudo column name.

CONNECT_BY_ISCYCLE

CONNECT_BY_ISCYCLE is a pseudo column for use in hierarchical queries. The column returns the value 1 if the row is part of a cycle in the hierarchy; that is, the row has itself as a direct or indirect ancestor given the CONNECT BY clause's search-condition. If the row is not part of a cycle, the column returns the value 0.

The data type of the column is SMALLINT and it cannot be null.

CONNECT_BY_ISCYCLE must be specified in the context of a hierarchical query but cannot be specified in the START WITH clause or the CONNECT BY clause, as an argument of the CONNECT_BY_ROOT operator, or as an argument of the SYS_CONNECT_BY_PATH function.

CONNECT_BY_ISLEAF

CONNECT_BY_ISLEAF is a pseudo column for use in hierarchical queries. The column returns the value 1 if the row is a leaf in the hierarchy as defined by the CONNECT BY clause. If the row is not a leaf, the column returns the value 0.

The data type of the column is SMALLINT and it cannot be null.

CONNECT_BY_ISLEAF must be specified in the context of a hierarchical query but cannot be specified in the START WITH clause or the CONNECT BY clause, as an argument of the CONNECT_BY_ROOT operator, or as an argument of the SYS_CONNECT_BY_PATH function.

LEVEL

LEVEL is a pseudo column for use in hierarchical queries. The column returns the recursive step in the hierarchy at which the row was produced. All rows produced by the START WITH clause return the value 1. Rows produced by applying the first iteration of the CONNECT BY clause return 2, and so on.

The data type of the column is INTEGER and it cannot be null.

LEVEL must be specified in the context of a hierarchical query but cannot be specified in the START WITH clause, as an argument of the CONNECT_BY_ROOT operator, or as an argument of the SYS_CONNECT_BY_PATH function.

End of change