Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL return empty record
Message
De
09/02/2004 08:48:34
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
09/02/2004 08:35:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00875407
Message ID:
00875412
Vues:
19
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform