0% found this document useful (0 votes)
27 views12 pages

Recovery Batch 9

Visual FoxPro is a robust database management system that supports large data tables, efficient data organization, and advanced features like object-oriented programming. It allows users to create, manage, and manipulate databases through various commands, including creating tables, modifying structures, and generating reports. The document also outlines the types of fields and data types supported by FoxPro, along with rules for naming fields and commands for data manipulation.

Uploaded by

kryash0006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views12 pages

Recovery Batch 9

Visual FoxPro is a robust database management system that supports large data tables, efficient data organization, and advanced features like object-oriented programming. It allows users to create, manage, and manipulate databases through various commands, including creating tables, modifying structures, and generating reports. The document also outlines the types of fields and data types supported by FoxPro, along with rules for naming fields and commands for data manipulation.

Uploaded by

kryash0006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

FOXPRO

INTRODUCINGFOXPROo.ADVANTAGEOF FOXPRO Or.


CHARACTERSICS OF FOXPRO:_Visual FoxPro is a powerful and flexible
database management system (DBMS). In many aspects it is strong industrial
DBMS
1. It can handle very large data tables, and also provides tools to safeguard
and inspect the data.
2. FoxPro provides with a set of powerful tools for sorting, retrieving, and
presenting data.
3. Its strong organizational concept helps managing databases very
efficiently.
4. Multiple databases can be linked together to give rise to a pyramid
structure of database system.
5. Queries can be made on user's request on the basis of selected criteria's
either from single or multiple database files.
6. Reports can be generated by grouping some fields with suitable headings
from a single or multiple databases.
7. Visual FoxPro wizards, like those in other Microsoft products, make it easy
to create tables, queries, reports, mailing labels, and other types of
information.
Visual FoxPro also adds advanced features such as object oriented
programming and database scheme, making it a more powerful tool for
application developers.
9. Visual FoxPro has its own menu builder to design customized menu
system for organizing the whole program. It also provides customized
windows for the display of suitable messages and screen activities.

WHAT ISA DATABASE?: A database is an organized collection of facts. A


Database generally refers to a store of data. In day-to-day life, we all have
experiences of organizing and storing data for future use. For example, an office
may have a simple database of all its employees. It maintained manually this
database will consist of many form containing columns for various details of the
employee like Name, Age, Address etc. As new employees join and old ones
leave, this database will be updated by adding new forms or removing old ones.
WHAT IS A RELATIONAL DATABASE?: Relational means joining multiple
tables used in an information retrieval process according to some relationship
specified by the user. Visual FoxPro is a relational database manager, and hence
gives us the choice to use one or more than one files at a time. It enables us to
define relationships between two or more files.

FIEDS AND DATA TYPES OF FOXPRO : A Database can be a single file or a


collection of files that store data. Before a file can store data, it has to be created.
Creation of a database generally involves specitying the structure of the files.
This means you would have to enter the names of the individual fields in the file,
the data type of the field and its size.

Rulesfor Namina FIELDS


A Field name cannot be more than 10 characters.
A field name cannot contain invalid characters like spaces, commas, hyphens,
colons etc. In between them. Ex.- EMP NAME is invalid however EMPNAME
IS valid.
>Filed name should always start with an alphabet and the remaining characters
can be the valid characters allowed. These include all the alphabets, numbers
and the underscore character.
In addition to the name of the fields, the file-structure also contains the type of
the fields, also referred to as DATA TYPES. The type of the field determines
what kind of data can be stored in a field. The data types in FoxPro are as
follows:

1. Numeric Fields:- These types of fields are used to store numeric data. These
fields can contain numbers, decimal point like 10,-122.25 etc. Numeric fields
can be used in arithmetic operations like addition, subtraction etc.
2 Alpha-numeric Fields or Character Fields:- These types of fields are used
to store character data like names of people, codes, descriptions of items, etc.
Character fields cannot be used in arithmetic operations like subtraction,
multiplication etc.
3 Date Fields:- These fields hold only date values i.e. the day/year. Just like
character fields they cannot be used arithmetic operations like multiply and
divide etc. however two date fields can be subtracted to give you the number
of days between the two dates.
Memo Fields:- Memo fields are just like character fields, but they can hold
information like scanned images, digitized sound etc. Note that memo fields
can contain large amounts of text data. The data in a memo field is not stored
in the database file but instead another file having the same name as the
database file but with the extension FPT get created. The data will be stored
in this file.
5 Logical Fields- These fields are used to hold the value .T. for TRUE or .F.
for FALSE or Y for Yes or N for NO. No other data case is stored in a logical
field.
6 Float Fields:- Like the Numeric data type, a Float also contains numeric data
which consists of numbers and a decimal point along with a sign. However the
difference between a numeric data type and a float data type is that the float
data type is used for scientific calculations because it stores more significant
digits internally, i.e. it is more precise.
7. General Field: The General data type is used to store OLE (Object Linkingg
and Embedding) objects that let you embed object created in one application
within applications written in FoxPro. For example, we can use a General
Field include spreadsheets created in one Window's application within your
FoxPro application.
Field widths are subject to maximum limit depending on the data type of the field.
These are listed below.

EIELD NAME MAXIMUMLENGTH


Character Fields 1 to 254 Characters

Numeric Fields 1 to 20 Digits


Date Fields 8 Characters
Logical Fields 1 Character

Memo Fields Will always take 10 characters in the DBF file, but
the size of the memo field is only limited by the
amount of space in the disk.
Float Fields 20 Digits
COMMANDS OF FOXPRO
3. CREATE: This command is used to create a table.

Syntax: CREATE <table name>

Ex: CREATE student

4 USE-This command is used to open a table. This is also used to closean


opened table.

Syntax: To open a database (table) file.


USE« table name>

Ex: USE student

Syntax: To close a database (table) file.

USE

5 MODIFY STRUCTURE:- This command is used to modify the structure of an


opened file.

Syntax: MODIFY STRUCTURE

& LIST: This command is used to display all records or specified records of an
opened table.

Syntax: LIST

LIST FOR <exp> :- This command is used to display all records which satisfy
the expression.
Ex: LIST FOR ROLL > 10

LIST <field name1, field name2,. This command is used to display the
records with specified fields.

Ex: LIST FIELDS roll, name, address

7. DISPLAY: This command works like list command. It also displays the
information of records.
) DISPLAY: Used for displays the information current record.
i) DISPLAY ALL Used displays ll the records like list command, butthe
difference is that it displays information page wise.
(ii) DISPLAY ALL FOR <exp>:- Used for displays the information of all
records for specified expression.
Syntax: DISPLAY ALL FOR <exp>
x DISPLAY ALL FOR ro11 >= 10
DISPLAY STRUCTURE Used for displays the structure of table.
( DISPLAY FIELDS< fieldname1, field name2,...> This command is
used to display the records with specified fields.

Syntax: DISPLAY FIELDS <fieldname1, field name2...

Ex DISPLAY FIELDS ro11, name, add

& BROWSE This command is used to browse records for modification of


current table.
BROWSE NOMODIFY: This command does not allow for modification,
only display records.
() BROWSE NOMENU:-This command does not show menu in menu bar.
(Gii) BROWSE NOAPPEND This command does not allow appending new
records.
(iv) BROwSE FIELDS This command browses the current opened table with
specified fields only.
Syntax: BROWSE FIELDS <field name1.Field name2,..

Ex BROWSE FIELDS ro11, name, address

(V) BROWSE FIELDS FOR:- This command displays the information of


current opened table of specified fields for specified condition.

Syntax: BROWSE FIELDS < field name1, field name2.. FOR <exp>
Ex: BROWSE FIELDS ro11, name, address FOR ro11< 10
(vi) BRowSE FREEZE: This command allows to modify the specified field
only.
Syntax: BROWSE FREEZE <field name»
Ex: BROWSE FREEZE ROLL
9 APPEND: used to append (add) new records in current table.
() APPEND BLANK: Usedfor appends one blank record in current opened
table.
i) APPEND FROM: This command appends records into current opened
table from another table.
Syntax: APPEND FROM < table name>
Ex: APPEND FROM student
(i) APPEND FROM stable name» FOR <exp> : This command appends
records into current opened table from another table according to certain
condition.
Syntax APPEND FROM <table name> FOR <exp>
Ex: APPEND FROM student FOR roll >=10
10.EDIT This command is also used for modifying records like browse
command but difference is that through browse command fields are arranged
in columns but through edit, fields are arranged in rows.

Note:Options of edit are same as browse command.

11.GOTO & SKIP These commands are used for Moving the record
pointernter from one record to another.
GOTOn: This command moves the record pointer to nh record number.
Ex: GOTO 15
GOTO TOP: This sends the record pointer to first record.
Syntax: GOTO TOP
GOTO BOTTOM: This sends the record pointer to last record.
Syntax GOTO BOTTOM
SKIP: This command moves the record pointer, one record ahead.
Syntax: SKIP
SKIP n: This command moves the record pointer, n records ahead.
Syntax: SKIP n
Ex: SKIP 2
(VI) SKIP -n: This command moves the record pointer, n records back.
Syntax: SKIP -n
Ex: DKIP 10
12 INSERTThis command is used to insert records anywhere in current
table.
() INSERT: This command inserts records after current record in current
opened table.
Syntax: INSERT
(i) INSERT BEFORE: This command inserts records before current record in
Current opened table.
Syntax: INSERT BEFORRE
(ii) INSERT BLANK: This command inserts a blank record after the current
record in current table.
Syntax: INsERT BLANK

REPLACE This command is used to replace existing data in fields of


current opened table with other data.
REPLACE <field> WITH <data/variable>: This command replaces the data
of specified field of the current record of current table with specified data or
value of variable.
Ex:- REPLACE roll WITH 8
REPLACE field> WTH < datavariable>, <field> WITH <data/variable>,
T h i s command replaces the value of more than one specified field
with data or value of variable of current record of the current table.
Ex: REPLACE roll WITH 8, name WITH "RAM
(ii) REPLACE ALL <field>WITH<data/variable> This command replaces data
of specified field/fields of all records of the current table with specified data
or value of variable.
Ex: REPLACE ALL marks WITH marks * 5

4. DELETE This command marks records with (") for deletion so that
further these records could be permanently deleted.
() DELETE: This command marks the current record of current table for
deletion.
Syntax: DELETE
(n) DELETE RECORDn: This command marks n record for deletion of current
table.
Syntax: DELETE RECORD n
Ex: DELETE RECORD 10
(i) DELETE NEXT n: This command marks next n records of current table for
deletion.
Syntax: DELETE NEXTn
Ex: DELETE NEXT 5
iv) DELETE REST: This command marks all records from current record to
the end of the current table for deletion.
Syntax: DELETE REST

(V) DELETE ALL: This command marks all records of current table for deletion.

Syntax: DELETE ALL

(V) DELETE FOR <exp>: This command marks those records for deletion of
current table whose expression is true.

Syntax: DELETE FOR <exp>

Ex: DELETE FOR marks> 500

15. RECALL: This command removes deletion mark for records of current
table.
RECALL: This command removes deletion mark for current record of
current table.
Syntax: RECALL
) RECALL RECORD n: This command removes deletion marks of n record
of current table.
Syntax: RECALL RECORD n
Ex: RECALL RECORD 10
(ii) RECALL NEXTn: This command removes deletion mark for next n
records of current table.
Syntax: RECALL NEXT n
Ex: RECALL NEXT 5
iv) RECALLL REST: This command removes deletion mark of all records from
current record to the end of current table.
Syntax: RECALL REST
(v) RECALL ALL: This command removes deletion mark of all records of
current table.
Syntax: RECALL ALL
(vi) RECALL FOR cexp>: This command remove deletion mark of those
records of current table whose expression is true.
Syntax: RECALL FOR cexp>
Ex: RECALL FOR marks> 500
16. PACK:-This command deletes permanently those records, which were
marked for deletion.
Syntax: PACK
17. ZAP This command deletes all records of currenttable.
Syntax: ZAP

8 SORTING Sorting is a method for arranging the records of a table in


ascending or descending order. In FOXPRO, SORT command is used for
this operation. SORT command creates a new file with same structure and
sorted records on a key field.
SORT TO <file name> ON <field name>: This command creates new
table and stores all records in ascending order on specified field.
Syntax: SORT TO <file name> ON < field name>
Ex: SORT TO sortname ON name
(i) SORT TO < file name> ON < field name >A: This command sorts the
records of current table on specified field to new table in ascending order.
Ex: SORT TO sortname ON name/A
(i) SORT TO <file name» ON < field name> D: This command sorts the
Current table on specified field to new table in descending order.
Ex: SORT TO new student ON name/D
iv) sORT TO <file name> ON <field name> FOR <exp>: This command
sorts the records of current table or specified field into specified new table
according to expression.
Ex SORT TO sortname ON name FOR roll> 10
19.INDEXING: Indexing is also used for sorting the records of a table. t doesn't
create another table like sort command. It creates index file, which arranges
the records of current table. The extension of single index file is'idx'.
Syntax: INDEX ON <field name> TO < file name>
Ex: INDEX ON name TO nameindex
() SET INDEX TO : This command is used to close the index file.
Syntax: SET INDEX To
(i) SET INDEX TO < index name>: This command is used to open the index
file.
Ex: SET INDEX TO nameindex
20.REINDEX This command is used of updating the existing index file that was
not active when table was updated.
Ex: REINDEX
Syntax: INDEX ON <field >TO < file name>FOR<exp>: This
command is used to index on specified field for specified expression.
Ex: INDEX ON name TO nameindex FOR ro11> = 10
21. QUIT This command is used to cdose the FoxPro application.
Ex: QUIT
2 DIR This command is used to display the files of disk. This command is
similar to DOS DIR command. We can also use the DOS wild card [] or [?]
to selected files.
Ex: DIR DBF
23 RENAME:-Rename command is used to change the name of a file.
Syntax:RENAME <old file name> To <new file name>

Ex: RANAME student.dbf To student1.dbf


24. ERASE This command is used to delete disk file permanently.
Syntax: ERASE file name>
Ex: ERASE student.dbf
25. HELP This command is used to display help information on screen
about the various FoxPro commands.
Syntax: Help <command name>
Ex: HELP create
foxpo
types o kields
SDescwibe bsieply the vasjous
SupPoxted m foxpxo -(2oes
dato displaung and
and
Deecsibe he followmg
commands witn Syntax and example:-
monitoxmg
eoed)
Displo
List
Bowse
Recal
e.Explam he follblmg foxpxo Commancis sao2]
ZAP
D Pack
BsousR

m o d i b y 6auchuxe

DEL
Commonds'
.Defme the followmg
APPenc
Bxouwse

Displa
Replace

ZAP

You might also like