DBASEIII COMMANDS -Notes
Database Organization: SORT, INDEX
· The SORT command gives us the ability to copy the record and structure of a database to another database.
· Files can be arranged in either ascending order or descending order by using SORT command.
· Sort command can be used in multiple fields for data arrangement.
· SORT command creates a new database file. But the new file contains records of the original database file only the order is different.
· Index command can also be used to organize a data file. When you index a database, you ask dBASE to create a separate and smaller file based upon designated fields in the database.
· The index command does not create a new database file. It creates an index file for the database with a default extension (.NDX).
· Unlike SORT command however INDEX does not permit the user to arrange the data in descending order
DIFFERENCE BETWEEN SORT AND INDEX COMMAND
· Creates a new database file
Does not create a new file
· Arranges the records in ascending and descending order
Arranges the records only in ascending order
· File extension is .DBF
File extension is .NDX
· Slower than index command
Faster than sort command
· Renumbers records
Does not renumber records
FIND and SEEK Commands
· The FIND and SEEK commands both are used in indexed database.
· FIND operates with character strings, while SEEK operates with either character string or numeric values.
· The SEEK command like FIND command also works only with an index file. When you SEEK command with strings, you must use quotes.
· The COUNT command helps in finding the number of records in the active database that meet a given condition.
· The LOCATE command is used to find the records in a database which satisfy certain conditions.
The Record Pointer
How did the EDIT command display only the 5th record? This can be explained by the concept of a record pointer that is maintained for each file opened by dBASEIII+.
The REPLACEcommand is used to REPLACE the contents of one or more specified field either the current record or all record, depending on the form of the command.
BROWSE command gives an option of adding new records. The BROWSE command also provides the option of displaying and modifying selective fields
The MODIFY STRUCTURE command helps to change the structure of an active database file. The command:
DELETE & PACK
· The delete command marks the current record for deletion
· Now delete all the records in the active database file BIODATA. You will find an asterisk (*) against the records marked for deletion.
· PACK CommandThis command removes records permanently from the database file. Once packed a record cannot be recovered. Deleting records in dBASEIII+ is a two step process. The records are first marked for deletion with the DELETE command, and then removed permanently from the file by PACK command
Let us take the following example
. USE BIODATA
. DELETE 3
Next if you give LIST command then you will not find record
The RECALL command is used to unmark those records that were marked for deletion with DELETE command. Like DELETE command, RECALL has several forms.
To allot work areas for different files in dBASE. dBASE assigns numbers 1 to 10 or characters A to J to these work areas. The general form of the SELECT command is
ALIAS Names for Database Files
dBASE has got a facility to give an alternate or an ALIAS name to a database file dB1
The SET RELATION TO Command
This command is used to link two database files with or without a common field between them
ACTIVE AND NON-ACTIVE FILES
When several files are in use by the SELECT command, the file that is selected last is called the active file and other files are called non-active files
1. 10 databases
2. The first work area in database is A.
3. SELECT command
4. The file that is selected last is called the active file and other files are called non-active files.
5. (a) ii (b) ii
1. CREATE or MODIFY commands are used in report creation.
2. Contents, Heading, Width, Decimal places, Total This Column are five sub menus of COLUMNS menu.
3. (a) iii (b) iii
The WAIT command suspends processing of a program and waits for the user to press any key. It accepts only a single keystroke and does not require the key to be pressed.