Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL return empty record
Message
From
09/02/2004 09:15:11
 
 
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:
00875419
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform