
Paradox Data Dictionary

Tutorial

                            Copyright  1992 of C&B International ApS

All rights reserved. No part of these manuals shall be reproduced, stored in a retrieval system, or transmitted by any means,
electronic, mechanical, photocopying, recording, or otherwise, without written permission from C & B International ApS. No
patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been
taken in the preparation of the manuals, C & B International ApS assumes no responsibility for errors or omissions. Neither
is any liability assumed for damage resulting from the use of the information contained herein. For information, contact
C & B International ApS, Digterparken 2, DK-2750 Ballerup, Denmark.

Trademarks

All terms mentioned in these manuals that are known to be trademarks or service marks are listed below. In addition, terms
suspected of being trademarks or service marks have been appropriately capitalized. C & B cannot attest to the accuracy of
this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service
mark.

Paradox is a registered trademark of Borland International.
APForm is copyright of Richplum Ltd.

Table of Contents:

1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  1

2. Starting the program and creating a new database. . . . . . . . . . . . . . . . . . . . .  2

3. Creating a new table with "CREATE TABLE". . . . . . . . . . . . . . . . . . . . . . . . .  3

4. Creating a new table from within "Database Manager" . . . . . . . . . . . . . . . . . . .  5

5. Restructuring tables with "Database Manager". . . . . . . . . . . . . . . . . . . . . . .  6

6. Field Dictionary - Surveying the fields of the database . . . . . . . . . . . . . . . . .  7

7. Field Dictionary - Creating a new table . . . . . . . . . . . . . . . . . . . . . . . . .  8

8. Expanding the Picture Dictionary. . . . . . . . . . . . . . . . . . . . . . . . . . . .   10

9. Defining Table Lookups (ValChecks). . . . . . . . . . . . . . . . . . . . . . . . . . .   11

10. Updating the Field Dictionary. . . . . . . . . . . . . . . . . . . . . . . . . . . . .   13

11. Field Dictionary - Editing the fields of the database. . . . . . . . . . . . . . . . .   14

12. Updating the Data Dictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   15

13. A Paradox Data Dictionary report . . . . . . . . . . . . . . . . . . . . . . . . . . .   16

14. Updating the Data Dictionary for the database. . . . . . . . . . . . . . . . . . . . .   17

15. Exiting Paradox Data Dictionary. . . . . . . . . . . . . . . . . . . . . . . . . . . .   18


1. Introduction

This tutorial will illustrate how Paradox Data Dictionary works, your possibilities with the program
and its general field of application. To do this, a practical example will be taken as a point of
departure.

Each chapter in this tutorial examplifies one task in creating the database. Every task is divided into
two parts: A short explanation of the task (under the heading Task) and a walk through the
mechanics (under the heading What to do). You should always read the "what to do" part of a
chapter as we often solve identical problems in different ways from chapter to chapter.

Should the tutorial leave some of your questions unanswered, we refer you to the User's Reference
Guide.

Case

The consultancy firm Doe & Roe, Ltd. has chosen to build up their PC database systems on the
basis of Paradox. For some time the firm has been developing small systems, but now faces a
situation where it has become increasingly difficult to get a clear picture of the construction of the
databases and an unreasonable amount of time is spent on maintenance and documentation.

To overcome these problems, Paradox Data Dictionary has been purchased. As a pilot project for
testing Paradox Data Dictionary, a new internal Customer Contact System has been chosen.

Initially, the system is to be used as a customer contact log for the consultants of the firm's Hot
Line. Later on, invoicing and statistics for hot-line services provided will be included.

The database should consist of these tables:

Customer    Information on customers who have received or have been promised hot line service,
            i.e. company No., company name, address, zip code, telephone No.

Consult     Information on consultants on the Hot Line, i.e. consultant ID, name, extension No.

Contact     Information on executed or promised service, i.e. arrangement No., company No.,
            consultant ID, a brief problem description, date of contact, reply date, total time
            consumption and contact person with the customer.

ͻ Lookup         ͻ Lookup         ͻ
  Customer  Ķ  Contact   Ķ  Consult   
ͼ Company No.    ͼ Consult        ͼ

The following syntax is used:

*     [Ins]             Hit the key - Ins.
*     "Contact"         Type the text - Contact.
*     Create            Choose the menu option - Create.

2. Starting the program and creating a new database

Paradox Data Dictionary is started as described under the section "Starting Paradox Data
Dictionary" in the Installation Guide.

You see the splash screen briefly after which the screen Databases will indicate that Paradox Data
Dictionary is ready for use.

Task:

Create a database called "Customer Contact System" in the directory "\CCS" on your hard disk.

What to do:

1)    Hit [Ins] to create a new database (Create Database).

2)    Type "Customer Contact System" and hit [Enter] to specify the database name in the field
      Database Name. This will place you in the Database Details screen, after creation of a
      project subdirectory.

3)    A description of the database - "System for registration of arrangements made in
      connection with Hot Line" - is typed in the field Description.

4)    The directory "\CCS" is entered under Directories (not RDA Home Dir!).

5)    Hit [F2] to save (Save). If one or more directories does not already exist, the program will
      create it/them after accept.

6)    Back in Databases you hit [Enter] to select the new database (Select Database).

If you later want to spread the database over more than one directory you can place yourself in the
Database Dictionary on the database and hit [F9] to enter the Database Details screen and specify
other directories.

You have selected "Customer Contact System" in Databases and are now in the main screen for
this database (Table Dictionary). If the table no. is 0 it is because there is no tables in the
directory.

A table can be created in three ways in Paradox Data Dictionary. In this Tutorial we will
demonstrate two of these.

3. Creating a new table with "CREATE TABLE".

Task:

Create the table "Customer":

Field Name        Type  Key?  Format      Required?  Picture           Low   High
Company #         N     *     F(0)        Yes                          1     20000
Company Name      A30
Telephone #       A11                                [{(###) ,1-800-}]###-####
Address           A30
Zip Code          S                                  #####


What to do:

1)    Activate the Menu in the Table Dictionary by hitting [F2].

2)    Select Create Table in the pop-up menu to create a new table.

3)    Enter the name of the table: "Customer".

4)    Type a description of the table in the Description field: "Customers who have contacted
      Hot Line".

5)    In Field Name you enter the field name "Company #", in Type the PARADOX field types
      "N", in Key you indicate by an asterisk that Company # is the only key field, in Format you
      indicate by typing "F(0)" that the field should be displayed with "Fixed" 0 decimals on
      screen (you can use General, Fixed, Comma and Scientific), in Required you indicate by
      "Yes" that Company # must be filled in for each customer record.

6)    Create the other fields after the same fashion.

7)    From a library of standard picture formats you select pictures for Telephone # and Zip Code.
      First position yourself in the field Telephone #, hit [F5] (Pictures). Move the cursor to the
      line with the picture format for "Phone number w. opt. area code" and hit [F2] (Select
      Picture). Then position yourself in the field Zip Code and select a suitable picture for this
      field after the same fashion.

8)    Move the cursor to Company #. The interval for Company # is specified by toggling to the
      next screen with [F7] (ValChecks). Here you enter the interval for Company # by typing
      "1" in Low and "30000" in High.

9)    Return to the previous screen by hitting [F7]. Here you make sure your table definition is ok.

10)   Save the table definition by hitting [F2] (Do_It!). This will bring you back to the Menu.

In Table Dictionary, it will now be indicated in the background that your database currently
consists of one table - Customer.

The way you have just created a table, is not so different from what you do in PARADOX, apart
from the fact that table structure (Field Name, Type and Key), Format and ValChecks (Picture,
Required, Low, High, Default, Lookup) are all defined and maintained together.

Later we are going to see how the Field Dictionary can be of use when you need to define
identical fields in different tables, or fields which are going to be the basis of links or lookups
between tables.

In the customer table, picture formats for Telephone # and Zip Code were fetched from a library of
standard pictures. This library (Standard Pictures) is, of course, accessible in connection with all
the databases. The library can be used to great advantage when a certain picture is going to be used
frequently in connection with other tables, e.g. fax numbers, account numbers e.t.c. The library can
be edited and expanded freely as required.

4. Creating a new table from within "Database Manager"

As an alternative method to Create Table you are now going to create a table in the semi-
graphical environment of the Database Manager. Here you have the same design and maintenance
features at your disposal, but the basis is a semi-graphical presentation of the database structure.

Task:

Create the table "Consult" with:

Field Name        Type  Key?  Format      Required?        Picture           Low   High
Consultant #      N     *     F(0)        Yes              ####
Name              A30
Extension #       A4                                       ####


What to do:

1)    In Menu you select Database Manager or you can use [Alt+F2] from the Table Dictionary
      screen. The present structure of your database will then be displayed. In our case only the
      table "Customer" is shown. You will see the Customer table presented as a box. Move the
      Customer box to the middle of the screen by using the [Arrow Keys].

2)    Hit [Ins] to select Create to create a new table.

3)    You will now be in the screen Create Table. Enter the name of the new table: "Consult".

4)    Make a description of the table in the field Description: "Consultants/employees on Hot
      Line".

5)    In Field Name you enter the field names of the table, in Type their PARADOX field types,
      in Key you indicate the key field with an asterisk, in Format you set the number format, in
      Required you indicate by "Yes"/"No" if it has to be filled in for each record.

6)    Enter "####" as a picture format for Consultant #. Use the same picture for Extension #".

7)    Save the table definition by hitting [F2] (Do_It!). This will bring you back to the Database
      Manager. The new table is displayed as a box which you also move towards the middle of
      the screen by using the [Arrow Keys].

Your database now consists of two tables. If connections between the two tables had been defined,
these would have been displayed as arrows between the boxes. Connections could be forms or
reports with multitable links or lookups.


5. Restructuring tables with "Database Manager"

Task:

How do you check or change the design of a table created in the Database Manager? If you have
followed the directions under "What to do" in connection with creating the table "Customer", you
will recall that 30000 was set as the maximum value (High) to be entered, and not 20000 as it was
specified in the task. This has to be corrected! And the field Zip Code was defined as short (S-
Type). The type A5 is more appropriate, however, so this also has to be corrected!

What to do:

1)    In the Database Manager you use [Tab] to switch between the tables. The current table is
      red. Select "Customer" with [Enter] (Structure).

2)    You will now have the same screen as when you created "Customer". You are going to edit
      the table and select [F9] (Restructure Table).

3)    Since the Table Description can only be changed from within the Table Dictionary, your
      cursor is in the first field of the table, in this case Company #.

4)    High is on the next screen: Hit [F7] (More).

5)    Change High to "20000" (did you detect the error when you created the table?).

6)    Return to the previous screen by hitting [F7].

7)    Move the cursor to the Type definition for Zip Code. Change "S" to "A5".

8)    Save the changes by hitting [F2] (Do_It!). The table (and its forms and reports) is now
      restructured.

9)    You now leave the Table Structure screen by hitting [Esc].

10)   Leave the Database Manager and return to Menu by hitting [Esc].

Please note that restructuring in PARADOX normally results in deletion of changed fields in
attached forms and reports. Paradox Data Dictionary will reinsert these fields automatically!


6. Field Dictionary - Surveying the fields of the database


The Field Dictionary gives you a survey of all fields in the database (in alphabetical order) and the
definitions of the fields. You are also told which tables use a particular field definition.

Task:

Which fields exist in the database? In which tables is the definition for Company # used? What
type is Company #?

What to do:

1)    Leave the Menu and return to Table Dictionary by hitting [Esc].

2)    Hit [F3] to activate the Field Dictionary.

3)    With the [Arrow Keys] you go through the field list. Are all fields there? - Both from
      "Customer" and "Consult"?

4)    You will notice that there are two Company # fields. The reason is that Paradox Data
      Dictionary automatically saves the old version of a field edited through Table Structure. To
      delete this redundant field, and all other fields not used in a table, hit [Alt+D] and then [Y].

5)    Move the cursor to the field "Company #". Hit [F5] (Change Field) to see which tables are
      using the definition for "Company #".

6)    Leave the table list by hitting [Esc].

7)    Leave the Field Dictionary by hitting [Esc].


We will postpone editing the database through the Field Dictionary till later.


7. Field Dictionary - Creating a new table

An important function of the Field Dictionary is to secure uniform field definitions or field
compatibility.

In connection with the design of new tables you will be able to copy the definitions from the Field
Dictionary. This is useful when tables are to have the same lookup fields or fields with identical
definitions.

Task:

Create the table "Contact":

Field Name        Type  Key?  Format      Required?  Picture     Low   High
Contact #         N     *     F(0)        Yes
Consultant #      N     *     F(0)        Yes        ####
Company #         N     *     F(0)        Yes                    1     20000
Received          D                                  ##.##.##
ReplyDate         D                                  ##.##.##
License #         A10                                &&&-####-&
ContactPerson     A30
TimeConsump       N
Problem           A200


The fields Consultant # and Company # have already been defined and can therefore be copied
from the Field Dictionary.

What to do:

1)    Hit [F2] in the Table Dictionary to get the Menu. Select Database Manager to get a
      display of the present structure of the database. The tables "Customer" and "Consult" are
      shown.

2)    Hit [Ins] (Create) to create a new table.

3)    You are now in the screen Create Table. Enter the name of the new table "Contact".

4)    Type "Service contacts via Hot Line" in the Description field.

5)    In Field Name you enter "Contact #", in Type "N", in Key you indicate with an asterisk
      that Contact # is a key field, in Format you say, by typing "F(0)", that the field should
      display with fixed 0 decimals, in Required you indicate by a "Yes" that the field must be
      filled in for each record.

6)    The fields Consultant # and Company # are copied from the Field Dictionary.
      First Consultant #:

      Positioned in an empty Field Name field you hit [F3] for Field Dictionary. In the field list
      you move the cursor to "Consultant #" and hit [F2] (Do_It!) to copy the definitions for the
      Consultant # field to the new table.

7)    And now Company #:

      Positioned in an empty Field Name field, you hit [F3] for Field Dictionary. In the field list
      you move the cursor to "Company #" and hit [F2] (Do_It!) to copy the definitions for the
      Company # field to the new table.

8)    In Field Name you enter "Received", "ReplyDate", "License #", "ContactPerson",
      "TimeConsumption" and "Problem". In Type the field types of the fields: "D", "D",
      "A10", "A30", "N" and "A200" respectively.

9)    To save your changes, hit [F2] (Do-It!).

8. Expanding the Picture Dictionary


The fields Received and ReplyDate are both of the type Date and should therefore have the same
picture. The field License # also needs a picture as it is to be expected that Doe & Roe is going
to register owners of program licenses later.

Task:

Check if a standard picture for dates already exists, such as MM/DD/YY. If not, you are to define
one. You also need to define a picture for Doe & Roe License #.


What to do:

1)    Hit [Enter] while on the newly created table to select it.

2)    Hit [F9] to be able to edit.

3)    Move the cursor to the field Received.

4)    Hit [F5] to activate the Picture library.

5)    There is no standard date, so you make a new picture. Move the cursor to the Name field.
      Hit [End] to get to the bottom of the list and [Arrow Down] to insert a new picture. Type in
      the name:

      US:         "Date MM/DD/YY". Hit [Arrow Right] and type "#[#]/#[#]/##".
      Europe:     "Date DD.MM.YY". Hit [Arrow Right] and type "#[#].#[#].##".

6)    Hit [F2] (Do_It!) to select the new Date Picture for the field Received.

7)    Use the same definition for the ReplyDate field. Move the cursor to the field ReplyDate. Hit
      [F5] (Picture) and select "Date" picture by hitting [F2].

8)    We are now going to make a picture format for "Doe & Roe License".

      Move the cursor to the field License #. Hit [F5] (Picture) and [Ins] in the Name field. Type
      in the Picture name "Doe & Roe License #" and type "&&&-####-&" in the Picture field.
      Then hit [F2] to select this picture for License #.

9)    So far so good!
      Before you go on to the next task, it might be a good idea to save your work. Hit [F2]
      (Do_It!) to save your work. Now hit [Esc] to return to the Database Manager.

Your database now consists of three tables. You now need to define the necessary connections
between the tables of the database.

9. Defining Table Lookups (ValChecks)

In connection with table design and the restructuring of tables we have seen how to define
ValChecks (ValCheck) together with the table structure. We have so far defined a maximum and
minimum value (High and Low) for a field.

It is also possible to make lookups to other tables (Lookup). This can be done to safeguard against
unauthorized data entry or to copy information from a lookup table.

When you wish to make a Lookup you have to specify how the lookup should be carried out:

1) JustCurrentField
      PrivateLookup :   Only compare fields.
      HelpAndFill :     Compare fields and copy field data.

2) AllCorrespondingFields
      FillNoHelp :      Compare fields and fill in all fields with identical field names (no
                        possibility of leafing through field values in the lookup table).
      HelpAndFill :     Like FillNoHelp except for the fact that you can leaf through field values
                        in the lookup table.

It should be noted, however, that lookups in both PARADOX and Paradox Data Dictionary require
that:

1)    The target field in the lookup table is the first field.

2)    The target field in the lookup table is of the same type as the field from which the lookup is
      made.

3)    There is only one key field in the lookup table.

These requirements must be met to enable you to make lookups in Paradox Data Dictionary.

The speed of the lookup will be improved if the field in the lookup table is a key field.


Task:

In the table Contact, it should not be possible to enter a consultant identification or a company
number which does not already exist in the tables "Consult" and "Customer" respectively. You
therefore need to make two lookups.

Only lookups for the fields Consultant # and Company # should be made if you want the
possibility of leafing through the various field values.

What to do:

1)    In the Database Manager (with "Contact" as current table) you hit [Enter] for Table
      Structure and [F9] for Restructure.

2)    Move the cursor to the field Company #. Select the next screen by hitting [F7] (More).

3)    Move the cursor to the lookup field. Hit [F1] (Tables) to choose between the possible
      lookup tables, i.e. the tables which have a first field with Name as the name and Type as the
      type. In this case this means "Customer".

4)    Move the cursor to "Customer" and hit either [F2] (Do_It!) or [F3] (With path name). [F3]
      should be chosen if you wish to include the path name. In the lookup field it will now say
      "Customer" or "\CCS\Customer".

5)    You now have to specify which lookup method to be applied. Choose JustCurrentField and
      then HelpAndFill.

6)    Then hit [Esc] to leave the lookup definition and [F7] to return to the first screen.

7)    You define the lookup for "Consult" in the same way. Move the cursor to the field
      Consultant #. Select the next screen by hitting [F7] (More).

8)    Move the cursor to the Lookup field. Hit [F1] (Tables) to choose between the possible
      lookup tables.

9)    Move the cursor to "Consult" and hit [F2] (Do_It!) or [F3] (With path name). The lookup
      field will now say "Consult" or "\CCS\Consult".

10)   Now specify which lookup method should be applied. Select JustCurrentField and then
      HelpAndFill.

11)   Hit [Esc] to leave the lookup definition and [F7] to return to the first screen.

12)   The table definition which has now been expanded with new pictures and the necessary
      lookups is saved by hitting [F2] (Do_It!). Hit [Esc] to return to the Database Manager. You
      will now see the new table presented as a box. Move the Contact box towards the middle of
      the screen using the arrow keys and hit [R] to refresh the screen.

      The three tables are now connected via the lookup definitions. These connections are
      presented as arrows with a "T" for Table Lookup.

10. Updating the Field Dictionary

Task:

A new table has been added to the database. It would be interesting to see if the Field Dictionary
contains the new fields of the table "Contact" and whether the field "Company #" is now used both
in the "Customer" as well as "Contact" tables (due to the lookup).

What to do:

1)    Hit [Esc] to leave the Database Manager and [Esc] to leave the Menu and then [F3] (Field
      Dictionary).

2)    Use the [Arrow Keys] to move about the Field Dictionary and check the fields.

3)    Move the cursor to Company #. Hit [F5] (Change Field) to see which tables use
      Company #. As you can see, both "Customer" and "Contact" use Company #.

4)    Return to Field Dictionary by hitting [Esc].


11. Field Dictionary - Editing the fields of the database

It is possible not only to see the field definitions in the Field Dictionary, you can also edit the
definitions so that the alterations are automatically implemented for all relevant tables, forms and
reports.

Using the Field Dictionary to restructure, you first check in Connected Tables, which tables a
given field refers to. Here you then select Restructure Field to restructure the field globally.


Task:

The field Consultant # in the tables "Consult" and "Contact" has previously been defined as a
numeric N field with the picture format ####. In stead of identifying consultants by figures we
want to use the consultants' initials. We therefore need an alphanumeric type with five characters
(A5) and with the picture format &&&&&.

Edit the field Consultant # in the Field Dictionary.

What to do:

1)    In the Field Dictionary you move the cursor to the Consultant # field. Then hit [F5]
      (Change Field).

2)    Hit [F9] (Restructure Field).

3)    You will be asked "Do you want to change the field for every table ? (y/n)". Here you
      should of course answer "Y" for yes.

4)    In Type the field is changed from "N" to "A5".

5)    In Picture the field is changed from "####" to "&&&&&".

6)    Accept the changes by hitting [F2] (Do_It!).

The field Consultant # has now been changed in both "Contact" and "Consult". To check this:

7)    Hit [Esc] to leave Connected Tables and [Esc] again to leave the Field Dictionary.

8)    In Table Dictionary you move the cursor to the table "Consult" and select it by hitting
      [Enter].

9)    When you have made sure that the field Consultant # has in fact been changed, you hit [Esc]
      to return to the Table Dictionary. "Contact" is checked in the same way.

12. Updating the Data Dictionary

Task:

To give the fields in the Field Dictionary sequential numbers (after we deleted some) you must
update the Data Dictionary before printing documentation of the database.

What to do:

1)    Hit [F10] to build the data dictionary.

2)    Check that only the field Field Dictionary has been checkmarked, if not use [F6] to delete
      the other checkmarks.

3)    Start updating by hitting [F2] (Do_It!).

You now have an updated Data Dictionary for the complete database.


13. A Paradox Data Dictionary report

The possibilities of documenting your database in Paradox Data Dictionary are many and varied.
You can vary the focus of the reports and how detailed they should be. This applies to databases,
tables, the Field Dictionary, forms and reports.

Task:

Print a list of all tables in the database with documentation of defined fields. The report should be
sent to the printer.

What to do:

1)    Select Report in Menu.

2)    As you want documentation of tables, you select Tables.

3)    You want full documentation and select All tables with family information.

4)    Select Printer and the documentation is printed.


14. Updating the Data Dictionary for the database

Updating the Data Dictionary for sizable databases may be quite time consuming if you have to do
it too often. Therefore updating has been assigned a menu option of its own so that it is only
carried out when you wish.

When the Data Dictionary is updated, all forms, reports, field formats, ValChecks and lookup
definitions for the tables are recorded.

There are four reasons for updating/building the Data Dictionary for a database: You have
created/changed a form, you have created/changed a report, you have changed something outside of
Paradox Data Dictionary or the database is not already in the Database Dictionary.

In the last instance you will of course have to generate information for all aspects of the database,
but for the other three instances it would be a waste of time to update everything. Therefore you
have the possibility to mark (Tag/Untag) the information you wish Paradox Database Dictionary to
scan for. For example if you have only changed a form, you should untag all fields except the two
form information fields Basics and Detail. For areas that are not included in the updating, the
existing information is automatically kept.

Task:

Generate a Data Dictionary for the whole database, as if it was a totally new database you wanted
to build information about. However, as you know there are no forms or reports for the tables in
the database, you should indicate that these areas are not to be included in the generation.

What to do:

1)    Select Build Data Dictionary in Menu.

2)    In the screen Tag/Untag you move the cursor to Forms. Remove the ticks ("") by using
      [F6] (Tag/Untag) as this area is not to be included.

3)    Reports should not be included either. Remove the ticks ("") at Reports by using [F6]
      (Tag/Untag).

4)    Hit [F2] (Do_It!) to start the generation.

During the updating the progression of the generation is reported continuously.

When the updating is done, the program returns to the Menu. Your Data Dictionary is now ready
for use.

15. Exiting Paradox Data Dictionary

This concludes the introduction to Paradox Data Dictionary. It only remains to end the program.


Task:

Exit Paradox Data Dictionary without returning to PARADOX.

What to do:

1)    Return to the Table Dictionary.

2)    Hit [Esc] to end the Table Dictionary.

3)    Hit [Esc] in the database list Databases to exit Paradox Data Dictionary, and hit "Y" to
      actually leave it.

