




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























a city.
Information.
collect data from user and manage that data properly, is called Database Management system.
is advance feature of DBMS. RDBMS provide the facility to create a relation between two tables.
record and column represent field.
other words Record is a collection values in fields of table.
perfect way Field is a collection of data of same type and nature.
width.
software for pc. This is enhanced version of the FoxBASE+ Software FoxPro is also called RDBMS software.
Rules to create a new file:-
Rules to create a New Field:-
Numeric datatype is use to store numeric data into a field. We can store 0 to 9 digit, decimal point and plus or minus sign. A numeric field can hold upto 20 digit wide. A numeric fields can also have a decimal part. The decimal part can be upto 0 to 18 digit. To store a field like Roll_no, mobile_no, phone_no, salary, pincode etc numeric field type is used.
2. Float :- Float datatype is similar to numeric. Difference between two is that for arithmetic calculation numeric datatype is used while float is used for scientific calculation. It can also hold upto 20 digit wide. We can store 0 to 9 digit, decimal point and plus or minus sign. To store the fields like Rate, percentage, average float is commonly used. 3. Character :- Character datatype is use to store string type information. It can store A to Z , a to z alphabets 0 to 9 digit and underscore with special symbols etc. To store the fields like name, address, result etc character is used. Character is default datatype for all the fields. In Character data type we can store upto 254 character. Default size of character is 10 fix. 4. Date :- Date datatype is use to store date in any field. The default format of date is (mm/dd/yy). The fix length of date is 8.To store the fields like Dob, doj, ex_date etc date field is used. 5. Logical :- The length of logical field is 1. we can store ‘T’ or ‘F’ or ‘Y’ or ‘N’ in logical field. ’T’ or ‘Y’ for true and ‘F’ and ‘N’ for False. To store the information like pass/fail, absent/present etc. logical field type is used. 6. Memo :- Memo field is special field of FoxPro in which you can store any amount of data. Memo field is use to store long textual information. The name of memo file has ‘.fpt’ extension. FoxPro allocates a ten bytes space in main dbf to store the location of memo data is in auxiliary memory. 7. General :- General field is use only for FoxPro for window version. In general field we can store textual data, picture, sound etc.
Note :- In FoxPro picture field type is not used.
[WHILE
List command displays all the records of currently open table and the result of expression. Syntax:- List [[FIELDS]
FOR
[WHILE
[OFF] clause:- Include OFF to suppress record number display. If OFF is omitted, the record number is displayed before each record.
Edit or Change command is use to edit the record which are inserted before by us. Syntax:- Edit [[FIELDS]
[FOR
[NOAPPEND] Clause :- If you include NOAPPEND in CHANGE, you can't add records to the table/.DBF by pressing Ctrl+N or choosing Append Record from the Browse menu.
[NODELETE ] Clause :- Including NODELETE prevents records from being marked for deletion from within a Change window. By default, a record can be marked for deletion by pressing Ctrl+T, choosing Toggle Delete from the Browse menu or clicking in the leftmost column of the record to be deleted.
[NOEDIT or NOMODIFY] Clause :- Including NOEDIT or NOMODIFY prevents you from modifying the table/.DBF. NOEDIT and NOMODIFY are identical. If you include either clause, you can browse or search the table/.DBF, but you cannot be edit it. However, you can append and delete records. Include NOAPPEND and NODELETE to prohibit the addition and deletion of records.
Browse command opens a browse window to change records of currently open data base file like a tabular format. Syntax:- Browse [FIELDS]
[[FIELDS]
[FOR
[WHILE
[FREEZE
[FONT
If you include the FONT clause but omit the font size
PACK command is use to permanently removes all records marked for deletion in the current table/.DBF. Synaex:- pack
ZAP command is use to permanently removes all records from current table/.DBF. by leaving just structure of a table. Example:- zap
Skip command is use to Moves the record pointer forward or backward in the current or specified table/.DBF. Syntax:- Skip
Go/Goto command is use to Positions the record pointer on the specified record number in a table/.DBF. Syntax:- Go
Replace command is use to insert a value in field. Replace is also use to change the value of fields in table/.DBF. Syntex:- REPLACE
Locate command is use to search the record sequentially in table/.DBF. for the first record that matches a given logical exp. Syntex:- LOCATE FOR
Locate command return the record number where it find the record with the true condition. Default scope of locate command is all records. Here for clause, scope clause and while clause works same as in other command. Plz to read from other command.
Sort command is useful to sort records of the current database file and stored in a new database file Each sort command generate a new database file. Syntex:- SORT TO
[/A | /D] [/C] Clause:- For each field you include in the sort you can specify an ascending or descending sort order. The /A option specifies an ascending order for the field, and the /D option specifies a descending order. /A or /D can be included with any type of field. By default, the field sort order for character fields is case sensitive If you include the /C option after the name of a character field, case is ignored. You can combine the /C option with the /A or /D option. Use one slash (/AC or /DC) if you include the /C option with /A or /D.
ASCENDING | DESCENDING Clause:- You can specify a sort order for all sort fields not followed by the /A or /D options. All sort fields are sorted in ascending order if you include ASCENDING. All sort fields are sorted in descending order if DESCENDING is included. The sort fields default to an ascending order if ASCENDING or DESCENDING isn't included. [
[WHILE
Seek command is use to search the record in index file. Seek search only in indexed file with an expression. Syntax : seek
Close all command is use to close all open programs, databasefile, indexfile etc. Syntax:- Close all Example:- Close all
Scatter command is use to Copy data from the current record to an array or a set of memory variables. Syntax:- Scatter [Fields
Gather command is use Store data from a memory variable array or a set of memory variables to the current record of the active table/.DBF.While Gather command is used its necessary database file is open. Syntax:- Gather from
If data is being copied from an array, the elements of the array are copied, starting with the first element,into the corresponding fields of the record. The contents of the first array element is copied to the first field of the record; the contents of the second array element is copied to the second field and so on.If the array has fewer elements than the table/.DBF has fields, the additional fields are ignored. If the array has more elements than the table/.DBF has fields, the additional array elements are ignored. Example:- use student Go bottom Gather from test Gather from test1 fields name,city,dob
(1) Abs():- This function returns the absolute value of the specified numeric expression. Syntax : Abs(
(2) Int():- This function returns the Ineger value from the specified numeric expression. Syntax :- Int(
(3) Floor():- This function returns the nearest integer value that is less than or equal to the specified numeric expression. Syntax : Floor(
(4) Ceil():- This function returns the nearest integer value that is greater than or equal to the specified expression. Syntax:- Ceil(
(5) Mod():- This function returns the remainder value by moduling expression1 to expression2. Syntax :- Mod(
(6) Round():- This function Return a numeric expression rounded to a specified number of decimal places. Syntax:- Round(
(7) Min():- This function Returns the expression with the lowest ASCII or numeric value or the earliest date in a list of character, numeric or date expressions. Syntax:- Min(
(8) Max():- Returns the expression with the highest ASCII or numeric value or the latest date from a list of character, numeric or date expressions. Syntax:- Max(
until
(4) Ains():- This function is use to Inserts an element into a one-dimensional array, or a row or column into a two-dimensional array. AINS( ) returns 1 if the element, row or column is successfully inserted. Syntax:- AINS(
Thus when we insert a new element in an array computer automatically drop the lat element and creat a blank space at specified no and default value is as .f. is assigned.
(5) Adel():- This function is use to Deletes an element from a one-dimensional array or a row or column from a two-dimensional array. If the element, row or column is successfully deleted, 1 is returned. Syntax:- ADEL (
(5) Asubscript():- This function Returns the row or column subscript of an element from the element's number. array. Syntax:- ASUBSCRIPT(
(5) Acopy(): This function is use to Copies elements from one array to another array.This function returns the number of elements copied to the destination array. Syntax:- ACOPY(
(1) Date():- Date function returns the current date in mm/dd/yy format. This function is use to print date on report. Foxpro display the date as set above in computer. Syntax : Date() Example :? Date() Output : 01/21/ Function returns : Date
(2) Year():- Year function returns the numeric year from the date expression.This function is always display the year with century. Foxpro display the as set above in computer. Syntax:- Year(
(3)Month():- Month function returns the numeric month from the date expression. Foxpro display the month as set above in computer. Syntax:- Month(
(4)Cmonth():- Cmonth function returns the name of month in character from the date expression. Foxpro display the monthname as set above in computer. Syntax:- Cmonth(
(5)Day():- Day function returns the numeric day value from the date expression. Foxpro display the day as set above in computer. Syntax:- Day(
(6)CDOW():- CDOW means character day of week.This function returns the character day from the date expression. Foxpro display the day as set above in computer. Syntax:- CDOW(
(7)DOW():- DOW means Day of Week. This function returns the Numeric day value from the date expression. Foxpro display the day as set above in computer.(0 for Sunday and 6 for Saturday) Syntax:- DOW(
(2) Asc():- This function Returns the ASCII code for the leftmost character in a character express Syntax:- Asc(
(3) Val():- This function Returns a numeric expression from a specified character expression composed of numbers. Syntax:- Val(
(4) Str():- This function Returns the character string equivalent to a specified numeric express. Syntax:- Str(
(5) Left:- This function Returns a specified number of characters from a character expression, starting with the leftmost character. Syntax:- Left(
(6) Right:- This function Returns the specified number of rightmost characters from a char string. Syntax:- Right(
( 7) Upper :- This function is use to convert specified character string in UPPERCASE format. Syntax:- Upper(
(8) Lower:- This function is use to convert specified character string in lowercase format. Syntax:- Lower(
(9) Proper:- This function is use to convert specified character string in Proper case format. Syntax:- Proper(
(10) Ltrim:- This function Returns the specified character expression with leading blanks removed. Syntax:- Ltrim(
(11) Rtrim:- This function Returns the specified character expression with all trailing blanks removed. Syntax:- Rtrim(
(12) Alltrim:- This function Returns the specified character expression with leading and trailing blanks removed. Syntax:- Alltrim(
(13) Isupper():- This function checks whether the first leftmost character of specified expression is in uppercase or not.If it find character in uppercase it return .t. else it return .f. as output. Syntax:- Is upper(
(14) IsLower():- This function checks whether the first leftmost character of specified expression is in lowercase or not.If it find character in lowercase it return .t. else it return .f. as output. Syntax:- Islower(
(15) IsDigit():- This function checks whether the first leftmost character of specified expression is digit or not. If it find digit it return .t. else it return .f. as output. Syntax:- Isdigit(
(16) IsAlpha():- This function checks whether the first leftmost character of specified expression is an alphabetic character or not. If it find character as Alphabet it return .t. else it return .f. as output. Syntax:- Isalpha(
(16) Len():- This function Returns the number of characters in a character expression. Syntax:- Len(
(25) Inlist():- This function checks whether or not an expression matches one in a series of expressions of the same data type. INLIST( ) returns true if it finds the expression in the set of expressions. If it doesn't find the expression in the set of expressions, INLIST( ) returns false. Syntax:- Inlist
(26) Difference():- This function Returns an integer, 0 through 4, representing the relative phonetic difference between two character expressions. Syntax:- Difference(
(27) Padl():- This function Returns a character string from a character expression padded to a specify length. This function insert padding in leftside.If you not specify padded character computer padded by blank space. Syntax:- Padl(
(28) Padr():- This function Returns a character string from a character expression padded to a specify length. This function insert padding in right side. If you not specify padded character computer padded by blank space. Syntax:- Padr(
(29) Padc():- This function Returns a character string from a character expression padded to a specify length in center. This function insert padding in bothsize .If you not specify padded character computer padded by blank space. Syntax:- Padc(
Set command are one type of command which is defiantly set by the FoxPro when can change them means set them when we needed.
Set alternate command is use to save your printer output created with ?, ??, DISPLAY or LIST to a text file. Syntax:- SET ALTERNATE ON | OFF or SET ALTERNATE TO [
Above example will create a new textfile name as my file and stores all the records of student database file
(2) Set carry command:- This function Determines whether or not FoxPro carries data forward from the current record to the new record created with APPEND or INSERT. This function is also helpful to carry forward only specific field. Syntax :- SET CARRY ON | OFF SET CARRY to
(3) Set century command :- By default the date format of year is in two digit. If we want to display year format as ‘yyyy’ we can set the century command to ON mode. Syntax:- Set century ON|OFF Example:- Set century ON Default clause:- OFF
(4)Set color command :- This set command is useful to set Background color and text color in FoxPro. By default white is background color and black is text color is set. We must have to specified picture code of FoxPro which are following. B---blue N---Black G---Green W---White I --- Inverce BG---Cray GR---Brown N+---Gray RB ---magenta GRT---yellow
Syntax:- Set color to
(5)Set Deleted command :- Set deleted command is use to specify whether or not FoxPro process on the records which are marked for deletion when set delete is on. FoxPro does process on marked records when commands like List, Display, Report.
Syntax:- Set Deleted ON | OFF Example:- Set Deleted ON Default clause:- OFF
(6)Set Device to command :- This set command is useful to set the output of @...say command to the specified device that is file, screen or printer. To screen option is use to set output in screen. File