<<<<< Section >>>>> Level Up <<<<< Page >>>>> Contents
 


8.3 Fields

8.3.1 Add a field
8.3.2 Edit a field
8.3.3 Field datatypes
8.3.4 Ranges
8.3.5 Field notes
8.3.6 Required fields
8.3.7 Delete a field


8.3.1 Add a Field

All control of fields in the relational database is controlled via the "Fields" page which is accessed through  View/Change  |  Fields  . The Edit Fields page is shown in Figure 8.3-1:


Figure 8.3-1: The relational database Edit Fields page


On the "Edit Fields" page, any number of new fields can be added at once by typing the required number of fields (a whole number) in the text box and pressing the "Go" button. As no two fields are permitted to have the same name, the default name for each newly created field is different. The default type for fields is "String". For more information on how to change the default attributes of the field, see section 8.3.3 - Edit a field.


8.3.2 Edit a Field

To change the name of a field, simply type over the existing name as displayed on the "Fields" page. Note that field names must be unique. If you enter two identical field names, Business Collaborator will automatically rename one of them.

The data type of a newly created field is set by selecting the appropriate datatype from the list provided. For more information on which datatypes are available and a description of how to convert the type of an existing field from one datatype to another, see section 8.3.3 - Field Datatypes.


8.3.3 Field datatypes

The available datatypes are shown in Table 8.3.1.

Table 8.3.1: Built-in Datatypes

Datatype Description Options Restrictions
Automatic date Automatically generates the date when a record is added. Static if selected, once generated a date will never change. Static turns a modify date into a create date.  
Automatic date and time Automatically generates the date and time when a record is added / edited. Useful as a time stamp for records. Static if selected, once generated a date and time will never change. Static turns a modify date and time into a create date and time.  
String Automatic ID Automatically generates an ID for the record - by default this is a number, however it is stored and sorted as a string. Prefix The characters you wish to appear at the beginning of your string style ID
Suffix The characters you wish to appear at the end of your string style ID
Padding The number of digits that feature in the ID. Will pad out with zeros if necessary. For example - setting the padding equal to 5 turns '1' into '00001'. Padding can help ensure correct numerical sorting on this field.
Only guaranteed to be unique if the field is a primary key.
Integer Automatic ID An integer ID that is automatically generated and cannot be modified. Sorting is performed numerically. If you require an automatic ID in your fields we would generally recommend this one. Show Selecting this will display the non-editable id within the add record form. There is no guarantee that the displayed ID will be the one stored with the record when multiple users are adding records simultaneously.  
Automatic User Name Automatically records the user who added / edited the record. Static if selected, once recorded the user will never change. Static turns a modify user into a create user.  
Boolean A true / false value with definable labels True Select the word you wish to represent true
False Select the word you wish to represent false
 
Currency A floating point number that displays to two decimal places - the number is stored internally to the input precision. Currency Units The units for the currency you wish to store. For example - £ p or $ cents. There is no requirement to have both boxes filled.  
Date Day / month / year   Day ≤ 31; Month ≤ 12; year must be 4 digits. The days in the month and leap years are all handled correctly.
Date and time A time followed by a date   Hours < 24; minutes < 60; seconds < 60; Day ≤ 31; Month ≤ 12; year must be 4 digits. The days in the month and leap years are all handled correctly.
Document Upload A field that allows a user to upload a document to the system which is then referenced by this field. By default, the object ID of the document is displayed in views of this information. Upload Destination By default, documents are uploaded to the folder or workspace which contains the relational database. However, if a folder is placed in this container, it will become selectable from this drop down list. All subsequent documents will be placed within. Existing document will not be moved.
Link Format Selecting this outputs the object reference in a form more suitable for JavaScript processing.
Clickable Selecting this option enables the object reference to be clicked.
Documents are not carried over when a database is archived using the DB Archive function, the folder settings will be. (See section 8.7.1.)
Email link Clicking on the link will create a new email message to this address.    
Floating point Numbers in decimal notation.    
Integer For positive or negative whole numbers.    
IP Address For storing computers' IP addresses.    
Members Of Table Allows a member of the current table (usually the workspace members) to be selected from a drop down list.    
Paragraph For longer text items   Text boxes will scroll automatically to fit text
String For short text items, e.g. a name   Displayed as a single line in a text box
Time Hours / minutes / seconds   Hours < 24; minutes < 60; seconds < 60
User Lock This field enables a record to be locked to the use who creates it. Only this user will be allowed to modify the record. The exception to this is that an administrator, relational database owner or the owner of the table can (a) modify the record and (b) decide who can modify the record by entering the user name into the box provided on the add / edit record form.   If a user name is entered then it must be valid.
URL Clicking on the link will take you to the website or folder. A new web browser window will be opened, containing the location indicated by the URL link.    


8.3.3.1 Convert Between Field Types

It is only possible to convert between a subset of the datatypes. All datatypes can be converted into strings. Strings can be converted into all the other datatypes provided that the string format is correct, e.g. dates should be specified as dd/mm/yyyy and times as hh:mm:ss. It is also possible to convert between floating point and currency datatypes.

To convert between datatypes of existing fields, go to the "Convert" page by selecting  View/Change  |  Convert  on the "Fields" page. Select the field which is to be converted and scroll through the list of alternative datatypes to find the new type for this field. To return to the original field type, click "Reset". Once the new datatype has been selected, click  View/Change  |  Convert Field  . The type of the field will then change. Note that it is possible to change the datatypes of fields which are primary keys - see section 8.5.1 - Primary Key.


8.3.4 Ranges

A valid range for the data in a field can be prescribed by specifying minimum and/or maximum values for the records. The "Range" page is accessed by selecting  View/Change  |  Edit Field Ranges  from the "Fields" page. It is only possible to specify ranges on certain types of fields - numerical, dates and times. An error will be reported when the field range is specified if the maximum value is less than the minimum. If any data entered is outside the limits specified, an error will be reported to the user indicating the valid range.


8.3.5 Field notes

The "Field Notes" column on the "Fields" page is intended to indicate the kind of information which should be entered in this field. It will often contain a sample record but may also be used to note some extra information about the field contents. If a table is imported into the database, a sample record will automatically be generated.


8.3.6 Required fields

A required field is one which must be non-empty for every record in the table. Making a field required is done by checking the "Required" column for that field on the "Fields" page. All primary keys (see section 8.5.1 - Primary Key) are made required automatically.


8.3.7 Delete a field

To delete a field, check the box in the "Remove" column of the "Fields" page beside the field to be removed. Clicking "Apply Changes" will complete the deletion of the field. You will be asked if you really want to do this since it may result in lost (inevitably) information from the database.

<<<<< Section >>>>> Level Up <<<<< Page >>>>> Contents
 Business Collaborator 4.9  © 1997-2003 Business Collaborator Ltd