Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query is not saved
Message
 
To
29/04/1998 18:38:07
Thomas Ianuzzi
Information Security Consultants, Inc.
Florida, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00095826
Message ID:
00095851
Views:
20
>I have produced a query which relates two tables, aircraft and pilots.
>In some cases there are no pilots who meet the condition PILOTS.PI_SEQ_NO=POLCOUNT. When this happens nothing is stored in the resultant cursor. Here is the query
>
>SELECT *;
> FROM RFQCURSOR LEFT OUTER JOIN YELLOW1!PILOTS;
> ON RFQCURSOR.NNUMBER_A=PILOTS.NNUMBER;
> WHERE PILOTS.PI_SEQ_NO=POLCOUNT;
> INTO CURSOR RFQCURSOR NOFILTER
>
>If there are no pilots I would like the query to keep the old contents of rfqcursor, Anyone have any ideas how to proceed.

Thomas, I am not sure why you are not getting Error 1815
("cursor" must be created with SELECT ... INTO TABLE ) if you do SELECT from your cursor into the same cursor, I never do that in the first place, but if it works and it is really what you need, you may try do it in two steps:

SELECT *;
FROM RFQCURSOR LEFT OUTER JOIN YELLOW1!PILOTS;
ON RFQCURSOR.NNUMBER_A=PILOTS.NNUMBER;
WHERE PILOTS.PI_SEQ_NO=POLCOUNT;
TO SCREEN NOCONSOLE
IF _tally >0 && there are pilots
SELECT *;
FROM RFQCURSOR LEFT OUTER JOIN YELLOW1!PILOTS;
ON RFQCURSOR.NNUMBER_A=PILOTS.NNUMBER;
WHERE PILOTS.PI_SEQ_NO=POLCOUNT;
INTO CURSOR RFQCURSOR NOFILTER
ENDIF
so if there are no pilots your old cursor stays.
But I personally would rethink the whole thing... :)

HTH,
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform