Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index built on UDF
Message
 
 
To
01/04/2003 23:02:32
Wayne Hamburger
Computer Software Consultants
Poway, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00772792
Message ID:
00772816
Views:
11
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
Previous
Reply
Map
View

Click here to load this message in the networking platform