Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select statement with Function
Message
De
19/09/2001 09:22:50
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
 
À
18/09/2001 16:06:46
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00558068
Message ID:
00558287
Vues:
15
>Is there a way to use one function in a select statement to return values for two distinct columns in the cursor?

My guess is that you're after something like FirstName and LastName from an ID. Perhaps you could send a parameter to your function like
SELECT GetName(ID, "First") AS FirstName, GetName(ID, "Last") AS LastName ...

*!* Dumb code here, but you get the idea
FUNCTION GetName(lnID, lcWhichName)

    LOCAL lcRetVal

    SEEK(ID, "SomeTable", "ID")

    IF lcWhichName = "First"
        lcRetVal = SomeTable.FirstName
    ELSE 
        lcRetVal = SomeTable.LastName
    ENDIF

RETURN lcRetVal
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform