home *** CD-ROM | disk | FTP | other *** search
- EXTERNAL DATABASE FUNCTIONS
-
-
- A. COMPRESS - Rewrite existing databases to optimize data
- B. EXTRACT - Extract data from a database to the screen or a file
- C. DB2DBF - Export data from a database to a dBase III file
- D. DBF2DB - Import data from a dBase III file
-
-
-
- A. COMPRESS - compress a data base
-
- External usage: pressdb databasename [-i indexname] [-s blocksize]
-
- pressdb compresses all the deleted data and unused space out of the
- data file of the ISAM (or LDM) database named "databasename". The
- "databasename" is the name of the database to compress (any extent is
- ignored). It may include a drive specifier and/or a pathname. The
- compression is done by copying the records to a temporary file,
- deleting the original file, then renaming the temporary file to have
- the original name.
-
- The arguments in square brackets [like this] are optional. If you do
- not specify any arguments at all, the program prompts you for them.
-
- The "-i indexname" (index) option tells the program to copy the
- records in the order of the index "indexname" instead of the Physical
- Index. Otherwise, the records are copied to the new data file in
- Physical Index order.
-
- The "-s blocksize" (size) option tells the program to make the new
- data file with a block size of "blocksize". Otherwise, the new,
- compressed data file has the same blocksize as the original data file.
-
- To compress the "maillist" database, copying in "zip code" index
- order, with a new block size of 1024, type:
-
- pressdb maillist -i "zip code" -s 1024
-
-
- COMMAND BAR
- -----------
-
- In the Database, the COMPRESS option will perform database rewrites
- on the following databases and tre respective indexes:
-
- Database Index Index by:
-
- GUNS Database: GUN1 Manumod Manufacturer, Model
- DEALER Deal State, City, Name
- MANUF Comp State, City, Name
- INVENT sdateIDX Sales Date, Manufacturer,
- Model
-
- It is a good idea to rewrite a database after additions or
- deletions are made. The databases above require about 3-5 minutes
- to rewrite. The function takes you into the gun database (most
- likely the largest database) just to make sure the writing process
- was successful.
-
- The other database tools, Import, Export, and Dumpdb must be run
- standalone due to input and redirect issues. These functions are
- described below.
-
-
-
-
- B. EXTRACT - tools program to dump data from database
-
- External usage: dumpdata databasename [-i indexname]
-
- dumpdata prints the records of the ISAM (or LDM) data file from the
- database named "databasename" to stdout in human readable form. You
- may redirect stdout to a disk file or to the printer in the usual way.
- The printing is done via the showrec ISAM routine.
-
- "databasename" is the name of the database to be printed (any extent
- is ignored). It should include a drive specifier and/or a pathname
- if the file is not in the current directory on the current drive.
-
- The "-i" (indexname) argument is optional. It tells the program to
- print the records in the order of the index named "indexname".
- Otherwise, the data records are printed in Physical Index order.
-
- If you do not specify any arguments at all, the program prompts you
- for them.
-
- To print the data records from the "maillist.db" file in "zip code"
- order, type:
-
- dumpdata maillist -i "zip code"
-
- To print the data records from the "maillist.db" file in "zip code"
- order to a file ( file.doc in this example ), type:
-
- dumpdata maillist -i "zip code" >file.doc
-
- To print the data records from "maillist.db" to the printer, type:
-
- dumpdata maillist >prn:
-
-
- C. EXPORT - convert an isam file to a Dbase III file
-
- Standalone usage: dbtodbf dbname [dbfname] [-i indexname]
-
- dbtodbf converts an ISAM DB file to an existing dBASE III DBF file
- by copying the ISAM records to the dBASE file in Physical Index order.
- No indexes are copied. "dbname" is the name of the ISAM file to
- convert. It should include a drive specifier and/or a pathname if the
- file is not in the current directory on the current drive.
-
- The arguments in square brackets [like this] are optional. If you do
- not specify any arguments at all, the program prompts you for them.
-
- "dbfname" is the name of the dBASE file to write to. If you don't
- specify a "dbfname", the program assumes that the dBASE file has the
- same name as the ISAM file but with a ".dbf" extent. The ".dbf" file
- MUST ALREADY EXIST and the converted ISAM records are appended to it.
- You can use the dBASE program to create the dBASE file. The "dbfname"
- may include a drive specifier and/or a pathname.
-
- Only fields whose names match exactly (except for upper/lower case)
- are copied. The order of the fields may be different in the two files.
- All field values are padded to the appropriate field size, since dBASE
- supports only fixed length records.
-
- The "-i indexname" option tells the program to copy the records in the
- order of the index named "indexname", instead of in Physical Index
- order.
-
- To convert records from an ISAM file named "newlist.db" to the
- existing dBASE file named "newlist.dbf" in the order of the "zip code"
- index, type:
-
- dbtodbf newlist -i "zip code"
-
-
-
- D. IMPORT - convert a dBASE III file to an isam file
-
- External usage: dbftodb dbfname [dbname] [-a] [-b] [-d] [-n]
-
- dbftodb converts a dBASE III DBF file to an ISAM DB file by copying
- the dBASE records to the ISAM file in physical order. No ISAM indexes
- are created (except the automatic Physical Index). You can use the
- Little Data Manager program (LDM) to create indexes for the converted
- file. dbftodb can copy records to an existing ISAM DB file, or you
- can create a new ISAM DB file.
-
- "dbfname" is the name of the dBASE file to convert. It should include
- a drive specifier and/or a pathname if the file is not in the current
- directory on the current drive. The arguments in square brackets [like
- this] are optional. If you do not specify any arguments at all, the
- program prompts you for them.
-
- The "dbname" is the name of the output file containing the converted
- records. It may include a drive specifier and/or a pathname. If you
- specify a "dbname", the ISAM records are written to that file. If you
- do not specify a "dbname", a file is created using the same root name
- as the dBASE file with a ".db" extent. In either case, if the ISAM
- file already exists, only those fields whose names match in both files
- are converted. If the ISAM file does not already exist, it is created
- to have the same fields in the same order as in the dBASE file, and
- every dBASE field (except memo fields) is converted.
-
- You may create the ISAM file beforehand with the LDM program or with
- your own application program. The ISAM file may include additional
- fields not in the dBASE record format; these fields are left blank
- during the conversion of new records. The ISAM file does not have to
- include every field from the dBASE file; only fields whose names match
- are copied.
-
- The fields in the ISAM record format may be in a different order than
- in the dBASE record format. The field names must match character by
- character, except that case (upper or lower) is not significant.
-
- The -a (append) option tells the program to append records to the ISAM
- file if the ISAM file already exists. If you do not use the -a option
- and there is already an ISAM file, the program prompts you to append
- to the file, overwrite the file, or abort the program.
-
- The -b (boolean) option tells the program to store false booleans as
- an empty field (zero length). This saves some space in the ISAM file
- if you have many records with false boolean values. Otherwise,
- boolean values from the dBASE file are stored as "T" for true and
- "F" for false.
-
- The -d (date) option tells the program to store only the last two
- digits; for example, "88". Otherwise, the year part of a date field
- is stored with all four digits; for example, "1988".
-
- The -n (numeric) option tells the program to strip leading blanks from
- numeric fields. Otherwise, leading blanks in numeric fields are
- preserved.
-
- Leading and trailing blanks are stripped from all character fields.
-
- To convert records from a dBASE file named "maillist.dbf" to a new
- ISAM file named "newlist.db", store False booleans as empty fields,
- and store only the last two digits of the date fields, type:
-
- dbftodb maillist newlist -b -d
-
-
-