Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL weird behavior
Message
De
02/09/1999 10:39:06
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
SQL weird behavior
Divers
Thread ID:
00260614
Message ID:
00260614
Vues:
66
Here's an interesting one.

I have a SQL like this:

SELECT * FROM MyTable;
WHERE MyCondition;
ORDER BY MyPrimaryKey DESCENDING INTO CURSOR MyCursor

It generates a cursor where the rows are ordered by the most recent primary keys.

If I print my primary key, it gives me a value which is not even in the cursor.

If I browse, I should be on the first row. So, I take note of the primary key. And, by browsing, I am by default at the top. I then do GO TOP and browse again. I can now see that I have one more record at the top. The primary key I took note is now on the 2nd row.

At that point, since I don't have the NOFILTER clause, a filter is applied on the table. If I do a NOFILTER clause, I get a correct behavior. However, I can't get the first record to be part of the cursor. It should be as it fits the condition.

It's probably time to DELETE TAG primarykey and index that one again.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform