Oracle Error Message
PLS-00651: implementation type in Aggregate/Table function should be a valid type
Reason for the Error
User tried to use some other database object like a package to define implementation type of an aggregate/table function.
Solution
Use a valid user defined type as implementation type.