Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue 186 #193

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
30 changes: 23 additions & 7 deletions source/packages/logger.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,11 @@ as
l_log_null_item_yn varchar2(1);
l_item_type varchar2(30) := upper(p_item_type);
l_item_type_page_id number;

type t_item_names is table of varchar2(255);
l_item_names t_item_names;
type t_item_values is table of varchar2(32767);
l_item_values t_item_values := t_item_values();
begin
$if $$no_op $then
null;
Expand All @@ -1118,19 +1123,18 @@ as
if logger.is_number(l_item_type) then
l_item_type_page_id := to_number(l_item_type);
end if;

insert into logger_logs_apex_items(log_id,app_session,item_name,item_value)
select p_log_id, l_app_session, item_name, item_value

select item_name bulk collect into l_item_names
from (
-- Application items
select 1 app_page_seq, 0 page_id, item_name, v(item_name) item_value
select 1 app_page_seq, 0 page_id, item_name
from apex_application_items
where 1=1
and application_id = l_app_id
and l_item_type in (logger.g_apex_item_type_all, logger.g_apex_item_type_app)
union all
-- Application page items
select 2 app_page_seq, page_id, item_name, v(item_name) item_value
select 2 app_page_seq, page_id, item_name
from apex_application_page_items
where 1=1
and application_id = l_app_id
Expand All @@ -1140,9 +1144,21 @@ as
or (l_item_type_page_id is not null and l_item_type_page_id = page_id)
)
)
where 1=1
and (l_log_null_item_yn = 'Y' or item_value is not null)
order by app_page_seq, page_id, item_name;

l_item_values.extend( l_item_names.count );
for i in 1..l_item_names.count loop
if l_log_null_item_yn = 'Y' or v(l_item_names(i)) is not null then
l_item_values(i) := v(l_item_names(i));
else
l_item_names.delete(i);
l_item_values.delete(i);
end if;
end loop;

forall i in indices of l_item_names
insert into logger_logs_apex_items(log_id,app_session,item_name,item_value)
values (p_log_id, l_app_session, l_item_names(i), l_item_values(i));

$end -- $if $$apex $then

Expand Down