Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed performance issues for 12.1 and 12.2 with source parsing using …
…dbms_preprocessor
  • Loading branch information
jgebal committed Aug 1, 2017
commit f1ee7ada2b620b9061f10b5640c8dae38d7d5c5d
25 changes: 13 additions & 12 deletions source/core/ut_metadata.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,20 @@ create or replace package body ut_metadata as
end;

function get_package_spec_source(a_owner varchar2, a_object_name varchar2) return clob is
l_lines sys.dbms_preprocessor.source_lines_t;
l_source clob;
l_lines sys.dbms_preprocessor.source_lines_t;
l_cursor sys_refcursor;
l_source clob;
l_view_name varchar2(128) := get_dba_view('dba_source');
begin
begin
l_lines := sys.dbms_preprocessor.get_post_processed_source(object_type => 'PACKAGE',
schema_name => a_owner,
object_name => a_object_name);

for i in 1..l_lines.count loop
ut_utils.append_to_clob(l_source, l_lines(i));
end loop;

end;
open l_cursor for 'select text from '||l_view_name||q'[ s
where s.owner = :a_owner and s.name = :a_object_name and s.type = 'PACKAGE'
order by s.line]' using upper(a_owner), upper(a_object_name);
fetch l_cursor bulk collect into l_lines;
-- we fetch the source explicitly as dbms_preprocessor is very sow on 12.1 and 12.2 when grabbing the sources.
l_lines := sys.dbms_preprocessor.get_post_processed_source(l_lines);
for i in 1..l_lines.count loop
ut_utils.append_to_clob(l_source, l_lines(i));
end loop;
return l_source;
end;

Expand Down