Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index built on UDF
Message
 
 
À
01/04/2003 23:02:32
Wayne Hamburger
Computer Software Consultants
Poway, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00772792
Message ID:
00772816
Vues:
10
What is your index expression? You should build it as non-structural index (idx). It's really not a good idea to have UDF in index expression, especially involving another table. View would be much better solution, I agree with Michel.

>A view won't work as I have 3 related tables, with 2 of the related tables relating directly to the parent table.
>
>I don't understand why my index based on a UDF isn't working. Any ideas. This is the code for one of the stored procedure UDFs:
>
>FUNCTION getcompname
>PARAMETERS xcCompanyID
>PRIVATE lcCurAlias, lcCompanyID, lcCompany
>
>lcCurAlias	= ALIAS()
>lcCompanyID	= ALLTRIM(xcCompanyID)
>lcCompany	= " "
>IF !EMPTY(lcCompanyID)
>	IF !USED("FindCompany")
>		USE Company IN 0 AGAIN ALIAS FindCompany
>	ENDIF
>	IF SEEK(lcCompanyID, "FindCompany", "Company")
>		lcCompany	= FindCompany.Name
>	ENDIF
>ENDIF
>IF USED("FindCompany")
>	USE IN FindCompany
>ENDIF
>
>SELECT (lcCurAlias)
>RETURN lcCompany
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform