2

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
  • :Can you gave an example i am not getting exactly what you want ,and please update your oracle version Commented Oct 4, 2012 at 15:18

1 Answer 1

6

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)

Sign up to request clarification or add additional context in comments.

1 Comment

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.