Is there a metadata table(s) in oracle that stores user defined types?
If someone does so开发者_高级运维mething like:
CREATE OR REPLACE TYPE some_type AS OBJECT(whatever NUMBER);
and then I do something like:
SELECT type_name FROM some_magic_table WHERE type_name = 'some_type';
should i reasonably expect oracle to work like this?
I don't wish to rely on Oracle SQL Developer interface to eyeball types all the time, that's why.
I am using 10g btw.
Thanks.
Yes, it is called USER_TYPES (I guess a SYS view).
Try this(if the type was created by the schema/user running this query):
SELECT *
FROM user_types
WHERE type_name = 'SOME_TYPE';
To look into TYPES that you have access to irrespetive of the schema:
SELECT *
FROM all_types
WHERE type_name = 'SOME_TYPE';
--
-- The types
--
SELECT *
FROM ALL_TYPES
--
-- Their attributes
--
SELECT *
FROM ALL_TYPE_ATTRS
精彩评论