Oracle Solution for Error ora-31097

Solution for Oracle Error ORA-31097

ORA-31097: Hierarchical Index not empty

What triggered the Error:

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

What should we do to fix it:

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