Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor disappears
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00501414
Message ID:
00501854
Views:
13
Hi,
You have 5 cursors called "csrWrg". Each will overwrite the one before - is this intentional?

I have often used the single character references to tables (FROM ScaleSetting s, Answer a ;) without a problem. MUCH easier than typing "MySecondTableInApp" dozens of times, and it's shown in many books as an acceptable technique.



>Hi,
>My csrPersonal just dissapear after i call form.doreport()
>This it the code:
>
>
>Form.INIT
>DODEFAULT()
>
>USE Answer AGAIN SHARED IN 1
>CURSORSETPROP("Buffering", 5, "Answer")
>
>USE Department AGAIN SHARED IN 2
>CURSORSETPROP("Buffering", 5, "Department")
>
>USE Division AGAIN SHARED IN 3
>CURSORSETPROP("Buffering", 5, "Division")
>
>USE Position AGAIN SHARED IN 4
>CURSORSETPROP("Buffering", 5, "Position")
>
>SELECT Employee_Name ;
>FROM Answer ;
>GROUP BY Employee_Name ;
>INTO CURSOR csrPersonal
>
>FORM.DOREPORT()
>
>SELECT COUNT(*) AS nCount, SubScale;
>FROM ScaleSetting s, Answer a ;
>WHERE a.Q_No = s.Q_No ;
>GROUP BY SubScale ;
>INTO CURSOR csrAnswer
>
>SELECT a.Q_No ;
>FROM Answer a, Question q ;
>WHERE a.Answer != q.PreferAnswer AND a.Q_No = q.Q_No ;
>INTO CURSOR csrWrg
>	
>SELECT COUNT(*) AS nWrg, SubScale ;
>FROM csrWrg t, ScaleSetting s ;
>WHERE t.Q_No = s.Q_No ;
>GROUP BY SubScale ;
>INTO CURSOR csrWrg
>
>SELECT s.SubScale,  30 AS nLowLevel, ((nWrg / nCount) * 100) AS nWrgPer, "C" AS cType ;
>FROM csrWrg s, csrAnswer a ;
>WHERE a.SubScale = s.SubScale ;
>INTO CURSOR csrCStatus
>
>SELECT COUNT(*) AS nCount, SubScale;
>FROM ScaleSetting s, Answer a ;
>WHERE a.Q_No = s.Q_No AND Employee_Name = .cboPersonal.VALUE ;
>GROUP BY SubScale ;
>INTO CURSOR csrPerAnswer
>
>SELECT a.Q_No ;
>FROM Answer a, Question q ;	
>WHERE a.Q_No = q.Q_No AND Answer != PreferAnswer AND ;
>	Employee_Name = THIS.cboPersonal.VALUE ;
>INTO CURSOR csrWrg
>
>SELECT COUNT(*) AS nWrg, Subscale ;
>FROM csrWrg w ,Scalesetting s ;
>WHERE s.Q_no = w.Q_no ;
>GROUP BY Subscale ;
>INTO CURSOR csrWrg
>	
>SELECT IIF(ISNULL(nWrg), 0, nWrg) AS nWrg, s.Subscale ;
>FROM csrWrg c RIGHT JOIN Scalesetting s ;
>ON c.Subscale = s.Subscale ;
>GROUP BY s.Subscale ;
>INTO CURSOR csrWrg
>
>SELECT c.SubScale, 30 AS nLowLevel, ((nWrg / nCount) * 100) AS nWrgPer, "P" AS cType ;
>FROM csrWrg c, csrPerAnswer a ;
>WHERE c.SubScale = a.SubScale ;
>INTO CURSOR csrStatus
>
>
>Any ideas?
>
>Thank you
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform