Hello,
I was asked to use REF CURSORS to solve the following problem, unfortunately I am still not able to figure it out.
The select statement in the function may return more than 1 value. I want all these values to be returned when this function is called from the java adaptors.
Will
CREATE OR REPLACE FUNCTION getParentNodes (nodeId NUMBER) RETURN NUMBER???****???? IS
=================
CURSOR cr_ParentNodes IS
SELECT parent_node_id
FROM t_arch
WHERE specified_in_dom = 1 AND
child_node_id = nodeId;
parentNodeId cr_ParentNodes%ROWTYPE;
BEGIN
OPEN cr_ParentNodes;
LOOP
FETCH cr_ParentNodes INTO parentNodeId;
EXIT WHEN cr_ParentNodes%NOTFOUND;
END LOOP;
CLOSE cr_ParentNodes;
RETURN parentNodeId.parent_node_id;
END getParentNodes;
be able to handle more than one value and return them to the java program.
Regards.
I was asked to use REF CURSORS to solve the following problem, unfortunately I am still not able to figure it out.
The select statement in the function may return more than 1 value. I want all these values to be returned when this function is called from the java adaptors.
Will
CREATE OR REPLACE FUNCTION getParentNodes (nodeId NUMBER) RETURN NUMBER???****???? IS
=================
CURSOR cr_ParentNodes IS
SELECT parent_node_id
FROM t_arch
WHERE specified_in_dom = 1 AND
child_node_id = nodeId;
parentNodeId cr_ParentNodes%ROWTYPE;
BEGIN
OPEN cr_ParentNodes;
LOOP
FETCH cr_ParentNodes INTO parentNodeId;
EXIT WHEN cr_ParentNodes%NOTFOUND;
END LOOP;
CLOSE cr_ParentNodes;
RETURN parentNodeId.parent_node_id;
END getParentNodes;
be able to handle more than one value and return them to the java program.
Regards.