What you have works fine, assuming you actually did create the type in the same schema as the table and package;
CREATE OR REPLACE TYPE "AST" AS VARRAY(255) OF varchar2(100)
/
Type AST compiled
create table PRODUCT(Attribute_Ua_Name varchar2(30))
/
Table PRODUCT created.
CREATE OR REPLACE PACKAGE ABC IS
FUNCTION F_PRODUCT_NAME(P_ATTRIBUTE_UA_NAME IN PRODUCT.Attribute_Ua_Name%TYPE)
RETURN AST;
END ABC;
/
Package ABC compiled
show errors
No errors.
If you get "PLS-00201: identifier 'AST' must be declared" then you either didn't actually run that statement, or you ran it in a different schema. If it is in a different schema then you can just prefix it with the owning schema name
FUNCTION F_PRODUCT_NAME(P_ATTRIBUTE_UA_NAME IN PRODUCT.Attribute_Ua_Name%TYPE)
RETURN owning_schema.AST;
I have created a package and table in same schema (ARCH) and type is created in different schema (INV_TEMP).
Then from your INV_TEMP
schema you need to:
grant execute on AST to ARCH;
and the function definition needs to refer to the type owner in the package specification in the ARCH
schema:
FUNCTION F_PRODUCT_NAME(P_ATTRIBUTE_UA_NAME IN PRODUCT.Attribute_Ua_Name%TYPE)
RETURN INV_TEMP.AST;
When you write the package body the function will also have to refer to the INV_TEMP
owner, both in the definition (to match the specification) and when declaring an INV_TEMP.AST
object variable or creating an object as part of a query.