Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INTO cursor Results to Screen
Message
From
12/12/2008 15:50:30
 
 
To
12/12/2008 15:30:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01367070
Message ID:
01367078
Views:
8
>I have a SQL statement that consistently brings the results to the screen in a MM desktop app. I am using VFP 9 SP2, but have set engine behavior to 7. This is not in a view, just a method on a form.
>
>select distinct student.cid ;
>	from  iepoint!student ;
>	left outer join iepoint!facts on student.cid = facts.cStudentid  ;
>	left outer join iepoint!IEP3744_CONF on student.cid = IEP3744_CONF.cStudentid ;
>	left outer join iepoint!enrollment on student.cid = enrollment.cStudentid ;
>	where &lmAllStuRules into cursor crsStudentsWhoMatchRules nofilter
>
>Even with my [INTO] statement, it brings the results to a query window in the desktop, the fails when I attempt to reference the cursor 2 lines down.
>My macro variable evaluates to:
>
>( FACTS.CHOMESCHID='00Z46H')
>
>This code works correctly in a command window, and a similar statement w/o the macro works. Thoughts?

How about removing the parentheses from your macro variable, so it reads just
FACTS.CHOMESCHID='00Z46H'
An unrelated general point, if you're comparing strings you might want to use "==" instead of just "=" e.g.
FACTS.CHOMESCHID=='00Z46H'
Update: another thing that's bitten me from time to time is having tab characters or other invisible/non-printing characters somehow lodged in a long statement like SELECT - SQL. Rather than copy/paste for testing purposes, you might try re-typing the entire statement to be sure you have no such characters in it.

If your macro variable is somehow including a character like that, VFP might be thinking the statement ends before hitting the INTO clause, which might explain what you're seeing.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform