The function dbms_stats.conv_raw is related to the procedure dbms_stats.convert_raw_value: it converts a raw value that is used to store statistical low high values to readable texts.
Such raw values are found, for example in the view dba_tab_columns.
The function's first parameter takes the raw value to be converted, the second parameter the numerical id of the datatype (which possibly corresponds to the typecode_* values in dbms_types).
with datatype_name_to_num as (
select 'NUMBER' nam, 2 val from dual union all
select 'VARCHAR2' nam, 1 val from dual union all
select 'DATE' nam, 12 val from dual union all
select 'CHAR' nam, 96 val from dual union all
select 'BINARY_FLOAT' nam, 100 val from dual union all
select 'BINARY_DOUBLE' nam, 101 val from dual
--
-- TODO: Complete numbers here with values found in dbms_types
--
)
select
col.owner,
col.table_name,
col.column_name,
--
dbms_stats.conv_raw(col.low_value, dt.val) lowValue,
dbms_stats.conv_raw(col.high_value,dt.val) highValue,
--
col.low_value,
col.high_value,
col.sample_size,
col.num_distinct,
col.num_buckets,
col.avg_col_len,
col.density,
col.histogram,
col.global_stats,
col.user_stats,
col.data_type,
col.*
from
dba_tab_cols col left join
datatype_name_to_num dt on col.data_type = dt.nam
where
col.low_value is not null
-- col.owner = 'RENE' and
-- col.table_name = 'TQ84_T'
;
See also
dbms_stats.conv_raw can be used, for example, when selecting values from dba_tab_histograms and dba_tab_columns.