Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL return empty record
Message
From
09/02/2004 08:48:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
09/02/2004 08:35:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00875407
Message ID:
00875412
Views:
21
Check that your function really returns to the previous work area. I am not sure about select(0), and I don't have VFP handy to check the help file; I always use select() to store the work area.

Also, why would the function end with RETURN .T.? It should return .T. or .F., depending on some condition. If you do RETURN .T. in the place marked with "*-- Som something", perhaps you are forgetting to return to the previous work area.

>Hi,
>I have a SQL statement that call my UDF. In the UDF, I have code to LOCATE the result as following.
>
>
>SELECT * FROM mytable WHERE myUDF() INTO CURSOR myresult
>
>FUNCTION myUDF()
>    *-- Some codes...
>
>    IF myCondition
>      lnWrk = SELECT(0)
>      SELECT myresult
>      LOCATE FOR condition1
>      IF FOUND()
>        *-- Som something
>      ENDIF
>
>      SELECT (lnWrk)
>    ENDIF
>
>    RETURN .T.
>ENDFUNC
>
>
>
>VFP returns empty record in result cursor for those records which match mtCondition.
>
>Any ideas?
>
>Thank you
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform