Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INTO cursor Results to Screen
Message
 
À
12/12/2008 15:30:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01367070
Message ID:
01367085
Vues:
10
>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?
>TIA
>Amanda

Amanda,
That query didn't make sense.
You select Student.CID but LEFT !!!! join the table in WHERE clause.
Also you JOIN several other tables which are NOT involved in query.
Why not just:
lmAllStuRules = "FACTS.CHOMESCHID='00Z46H'"
select distinct student.cid ;
       from  iepoint!student ;
       INNER JOIN  iepoint!facts on student.cid = facts.cStudentid AND &lmAllStuRules;
INTO CURSOR  crsStudentsWhoMatchRules nofilter
Also maybe you suppress error with some error handler.
What happens with this:
TRY
 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
CATCH TO oErr
    MessageBox(oErr.Message)
ENDTRY
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform