Oracle Solution for Error ora-36266

Solution for Oracle Error ORA-36266

ORA-36266: (XSCGMDLAGG00) Invalid context for the AGGREGATION function

What triggered the Error:

The AGGREGATION function was used outside of the MODEL context.

What should we do to fix it:

Use AGGREGATION only in a model.