1. In the Procedure dialog select Table Processing
2. Select Main Table Processing.
The Main Table Processing dialog appears. This
contains more fields than the ones youve seen so
far; you will need to think about the task you wish this program to perform. Specify the
Table as EMPLOYEE and accept the Identifying role as MAIN.
The manner in which records are read from the database is determined by the Access Mode. Eight different access modes are available,
but for the moment we shall consider just three:
Normal |
reads a record when its key, in this case EMPLOYEE_NUMBER, has been entered |
Already fetched |
is used for processing a record which has already been read from the database |
Window |
displays a list of existing EMPLOYEE records to select from and update |
3. Specify Access Mode as Normal, the default. We shall consider other methods of access later.
4. You want to be able to add new records to the EMPLOYEE table and modify and delete existing records. So, accept the defaults for the following questions:
Option |
Selection |
Update main table ? |
Yes |
Condition to update |
None |
Process existing records ? |
Yes |
Allow new records ? |
Yes |
New record dialog |
120 |
Allow record deletion ? |
Yes |
Record deletion dialog |
121 |
Deletion confirm required ? |
Yes |
Condition to delete |
None |
5. The default answers for New record dialog and Record deletion dialog are numbers which identify message maps. These are special maps, created automatically by QA Build, which appear automatically when a QA Build program needs to send a message to the user. Note that the numbers that appear on your system may be different to those specified here.
6. Leave the Auto-Increment Table? box unticked. Auto-incrementing is a facility whereby a new key is allocated automatically by the database for a new record. QA Build skips the remaining questions to do with auto-incrementing.
7. If, when you enter the EMPLOYEE_NUMBER key, no corresponding
EMPLOYEE record exists, you want the facility to scan forwards and backwards through
EMPLOYEE records until you find the one you want. You also want to add new EMPLOYEE
records to the database and to retype the EMPLOYEE_NUMBER if need be. There are several
Search methods to choose from; at least two of these, Scan
if no match and Always offer scan, satisfy
the above requirements.
Accept the default Search method, which is Always offer
scan. It differs from Scan if no match, in
that even if the record is found, the option to scan forwards and backwards is available.
Other search methods, namely Exact match and Multiple Choice are discussed later.
8. The procedure accesses the EMPLOYEE table using its primary key of EMPLOYEE_NUMBER, that is, using the main index. Accept the default for Search index, which is Main Index.
9. Take the defaults for the following options:
Option |
Selection |
Description |
Search depth |
! |
Entering ! allows QA Build to set the number of parts used in a multi-part key to an appropriate value automatically. This isnt an issue in your procedure, where the EMPLOYEE table is accessed only by EMPLOYEE_NUMBER |
Message if no record found |
122 |
The automatically generated message 122 is displayed when QA Build fails to find a matching record. You could look at, and change, this message, by pressing <E> to go to the map editor |
Message when record found |
None |
Normally, you dont want to display a message when a matching record is found |
Record scan dialog |
123 |
By selecting Always offer scan, you have provided the ability to scan through records. When doing so, this message allows you to accept the current record or select another |
10. QA Build skips the questions: map to display choice list, map to display item in list, map to attach choice list to, which are only appropriate to the Multiple choice and Window search methodswe shall use these in later lessons.
11. You can impose a condition that must be met for access to the EMPLOYEE table to be allowed, and a condition that must be met by an EMPLOYEE record for that record to be offered when scanning. We wish to do neither, so specify the following.
Option |
Selection |
Condition to access |
None |
Condition on record |
None |
Apply to record not on db ? |
No |
12. Record locking can ensure that you have exclusive access to a record at run-time. For your procedure, accept the defaults which dont invoke record locking:
Option |
Selection |
Description |
Lock existing record ? |
No |
Answering Yes would prevent other users updating the record until the user who locked the record has secured the changes to the database |
Disallow locked record ? |
No |
Answering Yes would prevent a locked record being read |
Locked record retry question |
None |
Allows you to present a map offering the user various courses of action when the record is found to be locked |
That completes the definition of the Main Table Processing screen. Confirm that it is filled out as follows:
[Screenshot to go here]
13. Click on OK to save the Main Table Processing screen.