Dear All,
While trying to create a master detail report using Oracle APEX 4.2 and BI Publisher. I tried creating report queries and report layout following the below mentioned steps.
CREATE TYPE emp_row AS OBJECT (
EMPNO NUMBER(4),
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2)
);
/
CREATE TYPE emp_tab AS TABLE OF emp_row;
/
CREATE TYPE dept_row AS OBJECT (
DEPTNO NUMBER(2),
DNAME VARCHAR2(14),
LOC VARCHAR2(13),
EMP_LIST emp_tab
);
/
SELECT SYS_XMLAGG (
SYS_XMLGEN(
dept_row(
d.deptno, d.dname, d.loc,
CAST(MULTISET(SELECT e.empno, e.ename, e.job, e.mgr, e.hiredate, e.sal, e.comm
FROM emp e
WHERE e.deptno = d.deptno) AS emp_tab)
),
SYS.XMLGENFORMATtYPE.createFormat('DEPT')
)
) AS "XML_QUERY"
FROM dept d
WHERE d.deptno = 10;
Though the above steps generates xml output while trying to generate in APEX it says unsupported datatype. Tried using DBMS_LOB as well no luck. Any inputs will be quite helpful. Should there be any other way to incorporate master detail report printing in APEX kindly advise.
Thanks
Ahmed