Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL return empty record
Message
De
09/02/2004 09:15:11
 
 
À
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:
00875419
Vues:
12
John,

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
Visual FoxPro returns empty record in result cursor for those records which match mtCondition.

Any ideas?


Preface: This is not a good programming technique.

1) *-- Some codes... ???
a) myCondition is USED('myresult') for skip SELECT build structure phase ?
b) condition1 is ???
c) *-- Som something ??? What do you do ?

Try this:
SELECT * FROM mytable HAVING myUDF() INTO CURSOR myresult

FUNCTION myUDF()
    *-- Some codes...

      SELECT myresult
      LOCATE FOR condition1
      IF FOUND()
        *-- Som something
      ENDIF

    ENDIF

ENDFUNC
Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform