We just moved off Oracle but I wrote this procedure for you in SQL Server (they should be very similar minus the CURSOR declarations).
CREATE PROCEDURE ShowRelationships
@parent AS int
AS
PRINT 'Parent = ' + CAST(@parent AS varchar(3))
DECLARE @child AS int;
DECLARE cur_children CURSOR
FOR
SELECT child
FROM PCREL
WHERE parent = @parent;
OPEN cur_children;
FETCH NEXT FROM cur_children INTO @child;
IF (@child IS NULL)
BEGIN
PRINT CAST(@parent AS varchar(3)) + ' has no children...';
END
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'Child = ' + CAST(@child AS varchar(3))
FETCH NEXT FROM cur_children INTO @child;
END
CLOSE cur_children;
DEALLOCATE cur_children;
SELECT TOP 1 @child = child
FROM PCREL
WHERE parent = @parent;
EXECUTE ShowRelationships @child;
GO