File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,20 +143,23 @@ declare
143143 function is_reporter(a_reporter_name varchar2 ) return varchar2 is
144144 l_reporter_name varchar2 (4000 );
145145 l_dummy integer ;
146- e_invalid_reporter exception;
147- pragma exception_init (e_invalid_reporter,-44002);
146+ l_owner varchar2 (4000 );
147+ e_invalid_object exception;
148+ e_not_a_reporter exception;
149+ pragma exception_init (e_invalid_object,- 44002 );
150+ pragma exception_init (e_not_a_reporter,- 6550 );
148151 begin
149- l_reporter_name := dbms_assert.simple_sql_name(a_reporter_name);
150- select 1
151- into l_dummy
152- from all_types
153- where connect_by_isleaf = 1
154- and type_name = 'UT_REPORTER_BASE'
155- connect by type_name = prior supertype_name
156- start with type_name = upper(l_reporter_name) ;
152+ l_reporter_name := upper ( dbms_assert .simple_sql_name (a_reporter_name) );
153+ -- a report is a valid reporter if it can be assigned as element of ut_reporters collection
154+ execute immediate
155+ ' declare
156+ r ut_reporters;
157+ begin
158+ r := ut_reporters( ' || l_reporter_name || ' ());
159+ end; ' ;
157160 return l_reporter_name;
158161 exception
159- when no_data_found or e_invalid_reporter then
162+ when e_not_a_reporter or e_invalid_object then
160163 raise_application_error(- 20000 , ' Invalid reporter name specified: ' || a_reporter_name);
161164 end;
162165
You can’t perform that action at this time.
0 commit comments