finding non anchored variable in oracle package

128 views Asked by At

How can we find all the variables in the package, that are not declared as anchored. Suppose I have a package as shown below:

create or replace pkg body test 
is 
 TYPE AnEntry IS RECORD (
  term    VARCHAR2(20),   --TERM IS NOT  ANCHORED 
  meaning VARCHAR2(200));  --MEANING IS NOT ANCHORED 

 procedure abc is 
  v_emp_id number;-- here v_emp_id is not an anchored variable 
 begin


 end abc;

end test;

I need a sql query, to which i pass the package name, and it will given me all the list of non anchored variables with line number.

Do we have any data dictionary views, which have such granular details, I have seen user_identifiers table, which gives granular details, but I can't such things to satisfy my condition.

1

There are 1 answers

0
Justin Cave On BEST ANSWER

Realistically, you'd need to go through the DBA_SOURCE view looking for strings like VARCHAR2(, NUMBER or DATE;.