what is sorting and indexing in foxpro

Introduction 


The sorting and indexing process is one of the most important parts of FoxPro. A detailed description of these things has been presented in this post with the aim of shedding complete light on how to do these procedures on the database and its various aspects. 


what-is-sorting-and-indexing-in-foxPro
 sorting and indexing

Sorting And Indexing Concept


Once a file is created, we often need to arrange it in a suitable order. There are two methods in FoxPro to set this up - Sorting and Indexing. In the sorting method, a separate file is created in which the records are arranged in a particular order. Whereas the purpose of the indexing method is also often the same. But it is a more convenient and better option.


Sort Command


sort command, as the name suggests, is used to sort the active file and then copy the arranged file to a new file. Using the method of sorting, facts can be arranged alphabetically, chronologically or numerically. Sorting can be done in both increasing and decreasing order.


What is sorting? 


The meaning of sorting is to group, arrange or classify things in a particular order. The purpose of sorting is to access things as quickly as they need. 


We see the trend of sorting everywhere. For example, in the warehouse of a company, we sort the goods in batch order, in order of production date and find them in that order as per the requirement. Similarly, any dictionary or vocabulary is usually arranged in alphabetical order. This makes finding a word very easy. All the departments and organizations organize the records or things in their own way.


When we are entering data in a database file, it is generally not in any order. It is also not possible that we enter the data by sorting. For example if we are entering data in a database file of a hospital then we enter it in order of patient arrival and the data we are entering is not necessarily the same as the data entered .


That is, he can be of any other department, age, gender, initials of the name everything can be different. Now when we are entering data like this then it will be a difficult task to find it on the basis of any particular order.


In this situation we need to sort the information in order to access it quickly. Foxpro is a database based software, which provides us with a simple method of sorting the data.


What is index in FoxPro?


You must be familiar with the name index. This process is similar to the index available at the end of the book with the help of which we can access the important points of the whole book on the basis of their page numbers. 


Indexes are also used in FoxPro to quickly access a particular record of a database file. Unlike sorting, the index process does not take up a lot of extra space in the disk and due to this process it also has a higher speed than sorting. You can also use the sorting command, as well as the menu, to index.


Foxpro provides the facility to create two types of index files. An IDX file that indexes on only one field and another CDX file that can be indexed on more than one field. This index file is automatically executed when the DBF file is used.


If any change is made in the database file, it can be updated using the REINDEX command. Memo fields and user defined functions cannot be indexed.


Also Read :

 

Post a Comment

0 Comments

Skip Ads