Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using recursion in SQL
Message
De
08/07/1999 08:29:32
Andrzej Majlich
Vulcan sp. z o. o.
Wroclaw, Pologne
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00238417
Message ID:
00238776
Vues:
12
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].
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform