Oracle
 sql >> Database >  >> RDS >> Oracle

Come ottenere informazioni su tutti i tipi di dati dichiarati in un determinato pacchetto

Usa PL/Scope...

alter session set plscope_settings = 'IDENTIFIERS:ALL';

... e ricompila il pacchetto (UTL_LOG nel mio caso) ...

alter package utl_log compile;
alter package utl_log compile body;

... e quindi interroga user_identifiers visualizza...

select name, type, object_name, object_type, line, col
from user_identifiers
where object_name = 'UTL_LOG'
    and usage = 'DECLARATION'
    and type not in ('VARIABLE','FUNCTION','FORMAL IN','FORMAL OUT','CONSTANT','PROCEDURE','FUNCTION','PACKAGE')
;

... che (nel mio caso) produrrebbe ...

NAME                TYPE    OBJECT_ OBJECT_ LINE COL
------------------- ------- ------- ------- ---- ---
ARR_SOME_COLLECTION VARRAY  UTL_LOG PACKAGE   19   6
REC_SOME_RECORD     RECORD  UTL_LOG PACKAGE   15   6
TYP_LOG_CODE        SUBTYPE UTL_LOG PACKAGE    8   9

Nota che PL/Scope può essere utilizzato per qualsiasi identificatore dichiarato/definito in qualsiasi unità di programma, non solo per le dichiarazioni dei tipi di dati.