c# - Get only Oracle function return table's columns and their types -
is there oracle query can use details of oracle function returns table, i'm looking info of table, record name, columns in record , types.
example function:
create or replace function return_table return t_nested_table v_ret t_nested_table; begin v_ret := t_nested_table(); v_ret.extend; v_ret(v_ret.count) := t_col(1, 'one'); v_ret.extend; v_ret(v_ret.count) := t_col(2, 'two'); v_ret.extend; v_ret(v_ret.count) := t_col(3, 'three'); return v_ret; end return_table; using type
create or replace type t_col object ( number, n varchar2(30) ); create or replace type t_nested_table table of t_col; knowing owner (system) , object name (return_table), want execute query return me info of t_col. names (i, n) , types (number, varchar2) of columns
i can't execute query cause there might scenarios there required inputs function won't known @ time when i'm trying column info
i'll executing query in c# .net
for current login, use
select uta.attr_name, uta.attr_type_name || case when uta.length not null '('||uta.length||')' else null end user_coll_types uct join user_type_attrs uta on uta.type_name = uct.elem_type_name uct.type_name = 'collection_name' order uta.attr_no; for logged in user having access on types users:
select ata.attr_name, ata.attr_type_name || case when ata.length not null '('||ata.length||')' else null end all_coll_types act join all_type_attrs ata on ata.type_name = act.elem_type_name , ata.owner = act.owner act.type_name = 'collection_name' , act.owner = 'owner_name' order ata.attr_no; for types present through out database (need have special permissions):
select dta.attr_name, dta.attr_type_name || case when dta.length not null '('||dta.length||')' else null end dba_coll_types dct join dba_type_attrs dta on dta.type_name = dct.elem_type_name , dta.owner = dct.owner dct.type_name = 'collection_name' , dct.owner = 'owner_name' order dta.attr_no;
Comments
Post a Comment