Hello,
My environment is
Oracle apex 5.1
ords. 18.1.1.95.1251
Oracle Database release 11.2.0.4.0
Os Windows 8.1 64-bit
jdk1.8.0_181
Google Chrome Version 69.0.3497.100 (Official Build) (64-bit)
-----------------------------------------------------------------------
Well, my requirements are:
1- Display the employee's name for each department. Then, to be able to edit departments and employees data through using the tree.
For this requirement i used the following code. It works just fine.
2- Display the employee pic attached to his name.
This part is ambiguous. Can any one guide me to resolve this problem please ?
Thanks in advance.
select case when connect_by_isleaf = 1 then 0
when level = 1 then 1
else -1
end as status,
level,
label||': '||name as title,
case when item_type = 'P' then 'fa-file-text-o'
-- when item_type = 'S' then 'fa-caret-square-o-right'
when item_type = 'T' then 'fa-minus-square-o'
else null
end as icon,
id as value,
case when tooltip is not null then name||' - '||tooltip
else name
end as tooltip,
case when item_type = 'P' then
apex_util.prepare_url('f?p='||:app_id||':5:'||:app_session||':T:::P3_SELECTED_NODE,P5_DEPTNO:'||id||','||id)
when item_type = 'T' then
apex_util.prepare_url('f?p='||:app_id||':4:'||:app_session||':T:::P3_SELECTED_NODE,P4_deptno,P4_EMPNO:'||id||','||link)
-- when item_type = 'S' then
-- apex_util.prepare_url('f?p='||:app_id||':10:'||:app_session||':T:::P3_SELECTED_NODE,P4_deptno,P10_ROWID:'||id||','||link)
end as link
from (
select 'P' item_type,
t.label label,
to_char(a.deptno) id,
null parent,
a.dname name,
a.loc tooltip,
null link
from dept a, (select wwv_flow_lang.system_message('Department') label from dual) t
union all
select
'T' item_type,
u.label label,
to_char(b.deptno)||'-'||to_char(b.empno) id,
to_char(b.deptno) parent,
b.ename name,
job tooltip,
b.deptno||','||b.empno link
from emp b, (select wwv_flow_lang.system_message('Employee') label from dual) u
-- from emp b, (SELECT dbms_lob.getlength(emp_pic) FROM emp where EMP_PIC is not null) u
)
start with parent is null
connect by prior id = parent
order siblings by name
Best Regards,
Amatu Allah.