Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting from an open table
Message
From
08/11/2000 01:38:04
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00439041
Message ID:
00439140
Views:
21
Well, the reason I need to perform my pre-save check on a sorted table is because this table is a tree structure. In order to perform the checks that I want, I need to follow the tree structure using a node notation stored in one of the fields. Actually there is more than just checks, it actually replaces some values on some branches, based on the values of other branches (records). That is why I need them to be in sorted order. As you said, I could save the table to a temporary table and then index it then, but that is more overhead than what I was hoping. Another way would be to do a bubble sort on an array, but that is also more overhead than what I was hoping. However, if there is no way to re-sort (or re-select) from a table in memory, I might have to opt for one of those options....


>>I have a cursor open with table buffering to which records get appended. At one point in my form I would like to "resort" all the records in order to perform some checks before the records get saved. So, what I would like to do is a SELECT * FROM ALIAS() ORDER BY fields
>>Therefore re-sorting all the records that are in the uncommited table in memory. However, this SELECT statement gets the fields from the commited records in the table, not the current uncommited table in memory. What can I do?
>
>SQL Selects open the target table again in another workarea in order to optimize themselves. Because of this, they have to work with the disk version of the table.
>
>You need use commands that work with the memory version. SCAN/ENDSCAN, DO WHILE/SKIP/ENDDO. Basically you need to copy your table to another source so you can work with it.
>
>Because of the overhead in this, I would not recommend it. I would suggest that you post your reasons for wanting to do this. You state you want to perform some checks on the modified records before updating them. I'm confused as to why you would need to do this. Can't the checks be made on an unsorted table? If not, then why? Maybe there is another way to reach your goal.
>
>Just some ideas.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform