Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select - SQL / Index and ICE!
Message
De
19/07/2001 12:10:21
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00532133
Message ID:
00532666
Vues:
12
This message has been marked as the solution to the initial question of the thread.
>Hello,
>
>Can anyone tell me how to better write the following SELECT:
>
>SELECT a.def_id, a.casenumber, a.vlastname, a.vfirstname, a.arrestnum, a.codenum, ;
>a.arrestdate, a.arresttime, b.lname, b.fname ;
>FROM defendan a, Person_a b ;
>WHERE a.arrestnum = b.arrestnum AND a.casenumber = m.case ;
>ORDER BY lname, fname ;
>INTO CURSOR lctest
>
>This is in a FPW 2.6 application. It works fine on some machines, but creates an ICE on other machines. On some machines, it works fine for a while, then creates an ICE. Once it creates an ICE, I can not get the SQL to work again without getting the ICE.
>
>I have traced the problem to the ORDER BY clause. If I remove the ORDER BY, the ICE does not occur.

So split it into two:
SELECT a.def_id, a.casenumber, a.vlastname, a.vfirstname, a.arrestnum, a.codenum, ;
a.arrestdate, a.arresttime, b.lname, b.fname ;
FROM defendan a, Person_a b ;
WHERE a.arrestnum = b.arrestnum AND a.casenumber = m.case ;
INTO CURSOR lctest1

SELECT * from lctest1 into curs lctest ;
ORDER BY lname, fname
If this is still too heavy, you can first select from defendan ... where a.casenumber = m.case into a first cursor, then join the results with the person_a, then order it in the third SQL. A spoonful at a time.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform