Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using recursion in SQL
Message
From
08/07/1999 08:29:32
Andrzej Majlich
Vulcan sp. z o. o.
Wroclaw, Poland
 
 
To
08/07/1999 08:04:16
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00238417
Message ID:
00238776
Views:
11
The function isn't recursive, because the rec position in the table reccmp is not preserved in a loop after a call. The position of current record is "the side effect" of function and shouldn't be used to control the while loop.

>FUNCTION PEGAINS
>LPARAMETERS CODCOMP
>SELE RECCMP
>GO TOP
>=SEEK(CODCOMP,'RECCMP','ind1')
>DO WHILE CODCOMP = RECCMP.IDCMP AND !EOF()
> IF !ISNULL(CHILDIDCMP)
> =PEGAINS(CHILDIDCMP)
> ELSE
> ? allt(str(IDCMP))+' - '+allt(str(IDISM))
> ENDIF
> SKIP
>ENDDO
_________________

*|| Andrzej [NJ].
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform