Oracle Error ORA-36765: (XSAGGCNTMOVE03) A string aggregation variable cannot have a string AGGCOUNT.

Oracle Error Message

ORA-36765: (XSAGGCNTMOVE03) A string aggregation variable cannot have a string AGGCOUNT.

Reason for the Error

The specified AGGCOUNT variable did not have the same permanence as the aggregation variable.

Solution

Select an AGGCOUNT variable with the same TEMPORARY or PERMANENT attribute as the aggregation variable.