Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Scott Black — — source: Informix-list mailing list archive (1991-1998)
I know someone out there must have done this before...
I have a table:
unit_link(
parent_no integer,
child_no integer...
Each child can have children of it's own, for as many levels as
necessary. I tried to build a recursive function call to build the tree
as follows:
function get_children(unit_no)
declare child cursor for
select child_no
from unit_link
where parent_no = unit_no
foreach child into this_unit
call get_children(this_unit)...
By now you see the problem. On the second time through I get error -400
(Fetch attempted on unopen cursor). Tech support says that this is the
way it is designed, you cannot re-use a cursor without first closing it.
It seems to me that each recursive call should be within it's own stack
and that re-using variables, cursors and the like should not be a
problem, but...
Is there another way to go about this w/o recursion? What methods have
any of you used to solve similar problems?
TIA
BTW this is HP-UX 10.20 OnLine 7.22 4GL 6.04
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.