Subject | Re: SPs and recursion |
---|---|
Author | duilio_fos <irel_llc@libero.it> |
Post date | 2003-02-21T14:28:33Z |
Svein,
After many trial, I got this code that actually works:
CREATE PROCEDURE WayBack(sol integer)
RETURNS
(result integer)
AS
declare variable i integer;
BEGIN
result=:sol;
suspend;
if (:sol = 0) THEN
exit;
select fm_sol from a_dep where to_sol=:sol into :result;
for select result from WayBack(:result) into :result do
begin
suspend;
end
END
Thank you
Duilio
>WayBack(5) naturally calls WayBack(5)this is clear now.
>Change your code to call fm_sol before calling WayBack and yourcode will work.
After many trial, I got this code that actually works:
CREATE PROCEDURE WayBack(sol integer)
RETURNS
(result integer)
AS
declare variable i integer;
BEGIN
result=:sol;
suspend;
if (:sol = 0) THEN
exit;
select fm_sol from a_dep where to_sol=:sol into :result;
for select result from WayBack(:result) into :result do
begin
suspend;
end
END
Thank you
Duilio