home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / personal / gitarid.zip / PRESSDB.DOC < prev    next >
Text File  |  1993-03-14  |  9KB  |  207 lines

  1.              EXTERNAL DATABASE FUNCTIONS
  2.  
  3.  
  4.     A. COMPRESS - Rewrite existing databases to optimize data
  5.     B. EXTRACT  - Extract data from a database to the screen or a file
  6.     C. DB2DBF   - Export data from a database to a dBase III file
  7.     D. DBF2DB   - Import data from a dBase III file
  8.  
  9.  
  10.  
  11.  A.    COMPRESS - compress a data base
  12.  
  13.     External usage:    pressdb databasename [-i indexname] [-s blocksize]
  14.  
  15.     pressdb compresses all the deleted data and unused space out of the
  16.     data file of the ISAM (or LDM) database named "databasename".  The
  17.     "databasename" is the name of the database to compress (any extent is
  18.     ignored).  It may include a drive specifier and/or a pathname.  The
  19.     compression is done by copying the records to a temporary file,
  20.     deleting the original file, then renaming the temporary file to have
  21.     the original name.
  22.  
  23.     The arguments in square brackets [like this] are optional.  If you do
  24.     not specify any arguments at all, the program prompts you for them.
  25.  
  26.     The "-i indexname" (index) option tells the program to copy the
  27.     records in the order of the index "indexname" instead of the Physical
  28.     Index.  Otherwise, the records are copied to the new data file in
  29.     Physical Index order.
  30.  
  31.     The "-s blocksize" (size) option tells the program to make the new
  32.     data file with a block size of "blocksize".  Otherwise, the new,
  33.     compressed data file has the same blocksize as the original data file.
  34.  
  35.     To compress the "maillist" database, copying in "zip code" index
  36.     order, with a new block size of 1024, type:
  37.  
  38.         pressdb maillist -i "zip code" -s 1024
  39.  
  40.  
  41.     COMMAND BAR
  42.     -----------
  43.  
  44.     In the Database, the COMPRESS option will perform database rewrites
  45.     on the following databases and tre respective indexes:
  46.  
  47.                           Database    Index     Index by:
  48.  
  49.         GUNS Database:    GUN1       Manumod    Manufacturer, Model    
  50.               DEALER     Deal    State, City, Name
  51.               MANUF      Comp       State, City, Name
  52.               INVENT     sdateIDX   Sales Date, Manufacturer, 
  53.                         Model
  54.  
  55.     It is a good idea to rewrite a database after additions or 
  56.         deletions are made. The databases above require about 3-5 minutes 
  57.         to rewrite. The function takes you into the gun database (most
  58.         likely the largest database) just to make sure the writing process
  59.      was successful.
  60.  
  61.         The other database tools, Import, Export, and Dumpdb must be run
  62.         standalone due to input and redirect issues. These functions are 
  63.         described below. 
  64.  
  65.  
  66.  
  67.  
  68.  B.    EXTRACT  -  tools program to dump data from database
  69.  
  70.     External usage: dumpdata databasename [-i indexname]
  71.  
  72.     dumpdata prints the records of the ISAM (or LDM) data file from the
  73.     database named "databasename" to stdout in human readable form.  You
  74.     may redirect stdout to a disk file or to the printer in the usual way.
  75.     The printing is done via the showrec ISAM routine.
  76.  
  77.     "databasename" is the name of the database to be printed (any extent
  78.     is ignored).  It should include a drive specifier and/or a pathname
  79.     if the file is not in the current directory on the current drive.
  80.  
  81.     The "-i" (indexname) argument is optional.  It tells the program to
  82.     print the records in the order of the index named "indexname".
  83.     Otherwise, the data records are printed in Physical Index order.
  84.  
  85.     If you do not specify any arguments at all, the program prompts you
  86.     for them.
  87.  
  88.     To print the data records from the "maillist.db" file in "zip code"
  89.     order, type:
  90.  
  91.         dumpdata maillist -i "zip code"
  92.  
  93.     To print the data records from the "maillist.db" file in "zip code"
  94.     order to a file ( file.doc in this example ), type:
  95.  
  96.         dumpdata maillist -i "zip code" >file.doc
  97.  
  98.     To print the data records from "maillist.db" to the printer, type:
  99.  
  100.         dumpdata maillist >prn:
  101.  
  102.  
  103.  C.  EXPORT - convert an isam file to a Dbase III file
  104.  
  105.    Standalone usage:  dbtodbf dbname [dbfname] [-i indexname]
  106.  
  107.    dbtodbf converts an ISAM DB file to an existing dBASE III DBF file
  108.    by copying the ISAM records to the dBASE file in Physical Index order.
  109.    No indexes are copied.  "dbname" is the name of the ISAM file to
  110.    convert.  It should include a drive specifier and/or a pathname if the
  111.    file is not in the current directory on the current drive.
  112.  
  113.    The arguments in square brackets [like this] are optional.  If you do
  114.    not specify any arguments at all, the program prompts you for them.
  115.  
  116.    "dbfname" is the name of the dBASE file to write to.  If you don't
  117.    specify a "dbfname", the program assumes that the dBASE file has the
  118.    same name as the ISAM file but with a ".dbf" extent.  The ".dbf" file
  119.    MUST ALREADY EXIST and the converted ISAM records are appended to it.
  120.    You can use the dBASE program to create the dBASE file.  The "dbfname"
  121.    may include a drive specifier and/or a pathname.
  122.  
  123.    Only fields whose names match exactly (except for upper/lower case)
  124.    are copied. The order of the fields may be different in the two files.
  125.    All field values are padded to the appropriate field size, since dBASE
  126.    supports only fixed length records.
  127.  
  128.    The "-i indexname" option tells the program to copy the records in the
  129.    order of the index named "indexname", instead of in Physical Index
  130.    order.
  131.  
  132.    To convert records from an ISAM file named "newlist.db" to the
  133.    existing dBASE file named "newlist.dbf" in the order of the "zip code"
  134.    index, type:
  135.  
  136.            dbtodbf newlist -i "zip code"
  137.  
  138.  
  139.  
  140.  D.   IMPORT - convert a dBASE III file to an isam file
  141.  
  142.     External usage:  dbftodb dbfname [dbname] [-a] [-b] [-d] [-n]
  143.  
  144.     dbftodb converts a dBASE III DBF file to an ISAM DB file by copying
  145.     the dBASE records to the ISAM file in physical order.  No ISAM indexes
  146.     are created (except the automatic Physical Index).  You can use the
  147.     Little Data Manager program (LDM) to create indexes for the converted
  148.     file.  dbftodb can copy records to an existing ISAM DB file, or you
  149.     can create a new ISAM DB file.
  150.  
  151.     "dbfname" is the name of the dBASE file to convert.  It should include
  152.     a drive specifier and/or a pathname if the file is not in the current
  153.     directory on the current drive. The arguments in square brackets [like
  154.     this] are optional.  If you do not specify any arguments at all, the
  155.     program prompts you for them.
  156.  
  157.     The "dbname" is the name of the output file containing the converted
  158.     records.  It may include a drive specifier and/or a pathname.  If you
  159.     specify a "dbname", the ISAM records are written to that file.  If you
  160.     do not specify a "dbname", a file is created using the same root name
  161.     as the dBASE file with a ".db" extent.  In either case, if the ISAM
  162.     file already exists, only those fields whose names match in both files
  163.     are converted.  If the ISAM file does not already exist, it is created
  164.     to have the same fields in the same order as in the dBASE file, and
  165.     every dBASE field (except memo fields) is converted.
  166.  
  167.     You may create the ISAM file beforehand with the LDM program or with
  168.     your own application program.  The ISAM file may include additional
  169.     fields not in the dBASE record format; these fields are left blank
  170.     during the conversion of new records.  The ISAM file does not have to
  171.     include every field from the dBASE file; only fields whose names match
  172.     are copied.
  173.  
  174.     The fields in the ISAM record format may be in a different order than
  175.     in the dBASE record format.  The field names must match character by
  176.     character, except that case (upper or lower) is not significant.
  177.  
  178.     The -a (append) option tells the program to append records to the ISAM
  179.     file if the ISAM file already exists.  If you do not use the -a option
  180.     and there is already an ISAM file, the program prompts you to append
  181.     to the file, overwrite the file, or abort the program.
  182.  
  183.     The -b (boolean) option tells the program to store false booleans as
  184.     an empty field (zero length).  This saves some space in the ISAM file
  185.     if you have many records with false boolean values.  Otherwise,
  186.     boolean values from the dBASE file are stored as "T" for true and
  187.     "F" for false.
  188.  
  189.     The -d (date) option tells the program to store only the last two
  190.     digits; for example, "88".  Otherwise, the year part of a date field
  191.     is stored with all four digits; for example, "1988".
  192.  
  193.     The -n (numeric) option tells the program to strip leading blanks from
  194.     numeric fields.  Otherwise, leading blanks in numeric fields are
  195.     preserved.
  196.  
  197.     Leading and trailing blanks are stripped from all character fields.
  198.  
  199.     To convert records from a dBASE file named "maillist.dbf" to a new
  200.     ISAM file named "newlist.db", store False booleans as empty fields,
  201.     and store only the last two digits of the date fields, type:
  202.  
  203.             dbftodb maillist newlist -b -d
  204.  
  205.  
  206.  
  207.