Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query is not saved
Message
 
À
29/04/1998 18:38:07
Thomas Ianuzzi
Information Security Consultants, Inc.
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00095826
Message ID:
00095851
Vues:
21
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform