Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL weird behavior
Message
From
02/09/1999 10:39:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
SQL weird behavior
Miscellaneous
Thread ID:
00260614
Message ID:
00260614
Views:
65
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
Next
Reply
Map
View

Click here to load this message in the networking platform