Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array passing in SQL UDF
Message
 
 
To
08/01/2000 14:47:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00314970
Message ID:
00315120
Views:
29
Hi Kenneth,

>I've fixed this problem by using a parameter object but would like to see if someone can explain why this happens.
>
>I have a UDF:
>
>
>FunctionX
>
>Parameter pArray
>
>For nCnt=1 to aLen(pArray,1)
>   Seek(pArray[nCnt,1],"ATABLE")
>EndFOr
>
>Return
>
>
>This work:
>
>FX="FunctionX(@myarray)"
>&FX
>
>This causes an error:
>
>FX="FunctionX(@myarray)"
>Select * From SomeTable Where &FX to cursor SomeCursor
>
>The error come from the UDF saying that pArray.prg is not found.
>
>Any ideas?

What should FunctionX return and what should it do? Move the pointer on the specific record? How is it related with your SQL.

Anyway, if it returns logical expression, you can simplify your life this way:

llRetValue=FunctionX(@myarray)

SELECT * From SomeTable Where llRetValue to cursor SomeCursor

Does it work?
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