Subject What is wrong with this Stored Procedure?
Author norgepaul
Hi,

Can anybody tell me what is wrong with this Stored Procedure?

It is supposed to return a path of the hierarchical data in the database.

---------------------------------------------------

SET TERM ^;

CREATE PROCEDURE GET_ITEM_PATH(A_ITEM VARCHAR(39))
RETURNS (ITEM_PATH VARCHAR(4000))
AS
DECLARE A_ITEM_PARENT VARCHAR(29);
BEGIN
IF (NOT (A_ITEM='ROOT')) THEN
BEGIN
SELECT ITEM_PARENT
FROM ITEMS
WHERE ITEM=:A_ITEM
INTO :A_ITEM_PARENT;

SUBNET_PATH_RES = GET_ITEM_PATH(A_ITEM_PARENT)||'/'||ITEM_PATH;
END
END

----------------------------------------------------

When I try to add the porocedure I get the error "Function unknown
'GET_ITEM_PATH'. Are recursive procedure calls not allowed in Firebird
or am I doing something wrong?

Cheers,
Paul