Trees and ROWIDs. Please Help !!
398072Jul 25 2007 — edited Jul 29 2007Hello Forum !!
I'm trying to set up a tree for display three levels of related data. I have three tables DEPT, EMP and ORDERS. EMP has a FK to DEPT and ORDERS has a FK to EMP. Each of these tables get his PK from a sequence; each table has his own sequence.
So I've implemented a view containing the following query implementing a hierarchical relatioship:
SELECT DEPT.ROWID ID_NODE
DEPT.DEPT_NAME NODE_NAME
NULL ID_PARENT_NODE
FROM DEPT
UNION
SELECT EMP.ROWID ID_NODE,
EMP.EMP_LAST_NAME || ' ' || EMP.EMP_FIRST_NAME NODE_NAME
DEPT.ROWID ID_PARENT_NODE
FROM DEPT,
EMP
WHERE EMP.DEPT_ID = DEPT.DEPT_ID
UNION
SELECT ORDERS.ROWID ID_NODE,
ORDERS.ORDER_NUMBER NODE_NAME,
EMP.ROWID ID_PARENT_NODE
FROM EMP,
ORDERS
WHERE ORDERS.EMP_ID = EMP.EMP_ID
Querying that view from sqlplus hierarchy looks fine. I've defined in APEX's tree creation wizard ID_NODE as ID, ID_PARENT_NODE as Parent ID and NODE_NAME as Leaf Node Text. I've also defined as a Tree Start the following LOV:
SELECT DEPT_NAME, ROWID
FROM DEPT
But when I run the page containing the tree I've got the following error:
Warning: Tree root ID "AAAQ2nAAWAAAAENAAB" not found.
and page dosn't display any tree at all... :(
There are some kind of issue for Apex 3.0 handling ROWID's ? Must I take another approach to solve this problem ? Any help will be very appreciated.