1+ ALTER SESSION SET PLSCOPE_SETTINGS= ' IDENTIFIERS:ALL' ;
2+
3+ -- install or comple all code here
4+ exec dbms_utility .compile_schema (USER,compile_all => TRUE,reuse_settings => FALSE);
5+
6+
7+ var errcnt number
8+
9+ column errcnt_a noprint new_value errcnt_a
10+ column errcnt_l noprint new_value errcnt_l
11+ column errcnt_c noprint new_value errcnt_c
12+
13+ -- find parameters that donot begin with A_
14+ prompt parameters should start with A_
15+ select NAME,TYPE,OBJECT_NAME,OBJECT_TYPE,USAGE,LINE ,COL , count (* ) over() errcnt_a
16+ from user_identifiers
17+ where type like ' FORMAL%' and usage = ' DECLARATION'
18+ and name != ' SELF'
19+ and name not like ' A#_%' escape ' #'
20+ order by object_name, object_type, line , col
21+ ;
22+
23+ prompt variables should start with L_
24+ -- variables start with l_ or g_
25+ select NAME,TYPE,OBJECT_NAME,OBJECT_TYPE,USAGE,LINE ,COL , count (* ) over() errcnt_l
26+ from user_identifiers
27+ where type like ' VARIABLE' and usage = ' DECLARATION'
28+ and object_type not in (' TYPE' )
29+ and (name not like ' L#_%' escape ' #'
30+ and name not like ' G#_%' escape ' #' -- TODO: only valid on package level
31+ )
32+ order by object_name, object_type, line , col
33+ ;
34+
35+ -- constants start with c_ or gc_
36+ prompt constants should start with C_
37+ select NAME,TYPE,OBJECT_NAME,OBJECT_TYPE,USAGE,LINE ,COL , count (* ) over() errcnt_c
38+ from user_identifiers
39+ where type like ' CONSTANT' and usage = ' DECLARATION'
40+ and (name not like ' C#_%' escape ' #'
41+ and name not like ' GC#_%' escape ' #'
42+ )
43+ order by object_name, object_type, line , col
44+ ;
45+
46+
47+ exec :errcnt := nvl(' &errcnt_a' ,0 ) + nvl(' &errcnt_l' ,0 ) + nvl(' &errcnt_c' ,0 );
48+
49+ -- quit :errcnt
50+ exit success
0 commit comments