
Chapter 7: Databases and Data Sources
Start time Time [TIME] Entry Required = No
End date Date [DATE] Entry Required = No
End time Time [TIME] Entry Required = No
Note Memo
[LONGVARCHAR]
Entry Required = No
Type
Integer [INTEGER] AutoValue = No; Entry Required = No
7. Right-click the field selector for the ID field (this is the area to the left of the field
name) and choose Primary Key.
8. Click File > Save.
9. Enter Appointments for the Table Name and click OK.
10. Close the table design window by clicking File > Close.
11. In the database window, click File > Save to save the work done so far on the
database.
Note: The type VARCHAR_IGNORECASE is a special type of VARCHAR specific to HSQLDB. It is case-insensitive
which means entries such as Home and HOME are the same.
Note: Each field can only accept data corresponding to the specified field type. It is not possible to enter text, for
example, in a number field. Memo fields in dBase III format are references to internally-managed text files which
can hold up to 64KB text.
Creating a related table
The last field of the Appointments table is the Type field. Since we are trying to follow good
database design procedures here, we want to put our appointment types in another table and
link the tables using an ID field. The basic reason for this is because so many of our
appointments are going to have the same type, we want to cut down on data entry errors and
make it easier to update all the records if we decide to change the name of a type.
To create the Types table:
1. In the database window, click Create Table in Design View.
2. Create the table using steps 3 through 5 in the previous example and the information
below.
Field
Name
Field Type Field Properties
ID Integer [INTEGER] AutoValue = Yes
OpenOffice.org User Guide for 2.x 366
Komentarze do niniejszej Instrukcji