Oracle Error ORA-31097: Hierarchical Index not empty

Oracle Error Message

ORA-31097: Hierarchical Index not empty

Reason for the Error

An attempt was made to rebuild the hierarchical index which is not empty.

Solution

Delete all rows in the hierarchical index and then rebuild it.