I want to generate a PL/SQL script that provide the attribute names of an object type defined by a user. I can see object types defined but I cant find attribute names of this object.
1 Answer
This works with Oracle 11g and should work with earlier versions
select attr_name
from all_type_attrs
where owner = YourSchemaName
and type_name = YourTypeName
If this object is in another user's schema you will need to have the execute permission before you can see this in all_type_attrs.
(Edited for clarity on permissions from APC's comment)
1 Comment
APC
Every user has access to the ALL_ views in the data dictionary. The thing is, they can only see data for objects which they have privileges on. That is, their own objects, things granted to PUBLIC and perhaps objects in other schemas. Perhaps you're getting confused with the DBA_ views?