Subject | Re: [ib-support] Re: SPs and recursion |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2003-02-21T08:29:06Z |
At 22:06 20.02.2003 +0000, you wrote:
of course this results in a never ending loop. E.g. let's say you call
WayBack(5). What is the first thing WayBack then does? Call WayBack(5). And
WayBack(5) naturally calls WayBack(5). Change your code to call fm_sol
before calling WayBack and your code will work.
Set
>CREATE PROCEDURE WayBack(sol integer)Duilio,
>RETURNS
> (result integer)
>AS
>BEGIN
> if (:sol = 0) THEN
> begin
> result = 0;
> suspend;
> exit;
> end
> for select result from WayBack(:sol) into :result
> do
> begin
> suspend;
> select fm_sol from a_dep where to_sol=:result into :sol;
> end
>END
>
>However, this code seems to fall into a never ending loop, as I get
>the error message:
of course this results in a never ending loop. E.g. let's say you call
WayBack(5). What is the first thing WayBack then does? Call WayBack(5). And
WayBack(5) naturally calls WayBack(5). Change your code to call fm_sol
before calling WayBack and your code will work.
Set