Oracle Error ORA-29921: Ancillary operator not supported with set view query block

Oracle Error Message

ORA-29921: Ancillary operator not supported with set view query block

Reason for the Error

Outer view query block contains ancillary operator and view query block contains union all.

Solution

Define the union-all view query to contain the primary and ancillary query terms. i.e. have the operators within the view definition rather than in the query outside the view.