Restructuring a Table
- Adding a New Field
- Moving a Field
- Changing Field Types and Sizes
- Character to:
- Numeric
- Date
- Logical
- Memo
- Numeric to:
- Character
- Date
- Logical
- Memo
- Logical to:
- Character
- Numeric
- Date
- Memo
- Date to:
- Character
- Numeric
- Logical
- Memo
- Date to:
- Character
- Numeric
- Logical
- Memo
- Memo to:
- Character
- Numeric
- Date
- RTF Memo
- Logical
- RTF Memo to:
- Character
- Numeric
- Memo
- Image File Reference to:
- Character
- Memo
Description
Once you have created a table, you can restructure it by adding, removing, or changing fields. To restructure a table, you need exclusive access to the table, which means no one else can be using the table. You restructure tables using the Table Editor, which has the same features as when creating a new table, except you cannot edit the indexes.
Adding a New Field
Display the Table/Sets tab of the Control Panel.
Select the table and click Design > Table Structure.
In the Restructure Table dialog enter a new field at the bottom of the list.
Optionally, move the new field to a different position in the record structure.
Moving a Field
Select the field you want to move, as in the illustration below.
Click a second time to change the black bar to a thin black line.
Holding the cursor down, drag the black line to the location where the field should be located.
Release the cursor.
Changing Field Types and Sizes
When restructuring a table that has data in it, you must be careful to avoid data loss. Data might be lost by changing a field's definition. For example, you might lose data if you change a field's width to a smaller value. Characters that do not fit into the new width are truncated. Data might also be lost if you change a field's type, as summarized below:
Character to:
Numeric
Converts valid numbers appearing before any other characters in the field (e.g. 100xyz is converted to 100). Retains decimal places if you specify decimal places for the numeric field. If you do not specify decimal places, values are rounded to the nearest whole number. Converts other data (including numbers with currency signs) to 0. Converting numbers with thousands separators isn't supported.
Date
Converts valid dates entered in the format MM/DD/YY, MM/DD/YYYY, MM-DD-YY, or MM-DD-YYYY appearing before any other characters in the field.
Logical
Converts the characters T, t, F, f, Y, y, N, or n appearing first in the field to a True or False value. All other characters return a False value.
Memo
Transfers all characters stored in the Character field to the Memo field.
Numeric to:
Character
Retains all values.
Date
Converts to NULL (blank)
Logical
Converts values equaling zero to F (false). Converts values greater or less than zero to T (true).
Memo
Retains all values.
Logical to:
Date to:
Character
Returns values in the format YYYY/MM/DD. For example, 09/20/2001 converts to 2001/09/20.
Numeric
Converts to NULL.
Logical
Converts to NULL.
Memo
Retains all values.
Date to:
Character
Returns values in the format YYYY/MM/DD. For example, 09/20/2001 converts to 2001/09/20.
Numeric
Converts to NULL.
Logical
Converts to NULL.
Memo
Retains all values.
Memo to:
Character
Retains characters that fit in the field. For example, a field that's 40 characters wide accepts the first 40 characters of memo text.
Numeric
Converts valid numbers appearing before any other characters in the field. For example, 100xyz is converted to 100. Retains decimal place digits if you specify decimal places for the numeric field. Converts other data (including numbers with currency signs) to 0. Converting numbers with thousands separators isn't supported.
Date
Converts valid dates in the format MM/DD//YY, MM/DD/YYYY, MM-DD-YY, or MM-DD-YYYY appearing before any other characters.
RTF Memo
Transfers all characters stored in the Memo field to the RTF Memo field.
Logical
Converts the characters T, t, F, f, Y, y, N, or n located in the first position in the field to a True or False value. All other characters return a False value. All other values return an uppercase F.
RTF Memo to:
Character
Retains characters that fit in the field. However, text formatting and font is not retained.
Numeric
Converts to NULL (blank).
Memo
Transfers all characters stored in the Memo field to the RTF Memo field. However, text formatting and font is not retained.
Image File Reference to:
Character
Displays text filename and path to image. For example:
=filename_decode("exe_folder\Samples\Alphasports\hotbar.bmp")
Memo
Displays text filename and path to image. For example:
=filename_decode("exe_folder\Samples\Alphasports\hotbar.bmp")
See Also