Progress
Basic Database
Tools


Schema>Modify Table

Choose Schema Modify Table to change the structure of a table.

When you choose this option, Progress alphabetically lists all the tables defined for your database. After you select a table, a window similar to the one shown in Figure 9–1 appears.

Figure 9–1: Modify Table Window

Choose the Field Editor button to edit fields for the selected table. See the "Schema>Field Editor" section later in this chapter for more information.

This window contains the following user-interface elements:

Table Name

Specifies the name for the table. Table names can be up to 32 characters long and can consist of alphabetic characters, digits, and the characters $, &, #, %, -, and _. In addition, table names must begin with a letter (A–Z or a–z). You cannot use reserved Progress keywords as table names. Table names are not case sensitive.

Area

Displays the name of the storage area. The Area Name is assigned to a table when it is created. Because the Table Name cannot be updated, this field is disabled.

Table Type

Displays the table type. For this release, the only available table type is PROGRESS.

Label

Specifies the label used in error messages.

Owner

Displays the user ID of the table owner. This information is necessary for manipulating certain dataservers.

Replication

Specifies the name of the procedure that performs the replication for this table. For more information about replication, see the chapter on data replication in the Progress Database Administration Guide and Reference.

DataServer Name

Specifies the table name in the appropriate dataserver database if the table is not a Progress table.

DB Link

Specifies the link name for the distributed ORACLE database.

Description

Describes the table contents.

Hidden

Specifies if the table is a hidden table. The default value is no.

Frozen

Specifies if the table is frozen. You can freeze or unfreeze a table using the Freeze/Unfreeze option from the Utilities menu. When a table is frozen, you can only view its properties. The actual record data is not frozen, only the data definitions.

Dump File

Specifies the file to which you want to dump the table contents. The name must be unique among the other tables in the database and can be up to eight characters long. The default filename is the table name. If the table name is longer than eight characters, Progress truncates it to the first eight characters.

Record Size

Specifies the size of the record used for dataservers with fixed-length records.

The following sections describe the options that appear at the bottom of the window:

Table Validation Option

Choose the Validation option in the Modify Table dialog box to specify validation criteria and a message for record deletions.

NOTE: You should use table validation for backward compatibility for procedure-driven applications. For event-driven programs, Progress Software Corporation recommends that you use table delete triggers instead of table validation.

If you choose the validation option, a dialog box similar to the one shown in Figure 9–2 appears.

Figure 9–2: Table Validation Dialog Box

This window contains the following user-interface elements:

Valmsg

Specifies the message Progress displays when a user tries an invalid deletion. There is no limit to the number of characters you can enter, but a message up to 63 characters long can fit onto the two message lines without scrolling.

Valexp

Specifies the criteria for valid deletions. For example, in the customer table, to restrict deleting customers to those customers who have no outstanding orders, enter the following criteria:

NOT (CAN-FIND(FIRST order OF customer)) 

Table Triggers Option

Choose the Table Triggers option in the Modify Table dialog box to define schema triggers for a table. If you choose the Table Triggers option, a window similar to the one shown in Figure 9–3 appears.

Figure 9–3: Table Triggers Dialog Box

The Table Triggers dialog box contains the following user-interface elements:

Overridable?

Specifies whether a session trigger can override the schema trigger. The default value is no. See the Progress Programming Handbook for more information about schema and session triggers.

Check CRC?

Specifies whether Progress verifies the cyclical redundancy check (CRC) code. The default value is no. When Progress checks the code, it compares the stored CRC value of the procedure to the CRC of the trigger when it fires.

Choose the database event for the trigger you want to create. Table 9–2 lists the available database events.

Table 9–2: Table Trigger Events 
Event
Description
CREATE
Specifies that the trigger executes every time Progress executes a CREATE or INSERT statement for the table you are modifying.
DELETE
Specifies that the trigger executes every time Progress executes a DELETE statement for the table you are modifying.
FIND
Specifies that the trigger executes every time Progress reads a record in the table you are modifying using a FIND statement or a FOR EACH loop. Only records that satisfy the full search conditions (such as a WHERE clause) cause a FIND trigger to execute. The CAN-FIND statement does not cause a FIND trigger to execute.
WRITE
Specifies that the trigger executes every time Progress validates a record (if any change took place). Progress automatically validates a record when it releases it.
REPLICATION-
CREATE
Specifies the trigger that executes immediately following the execution of the CREATE trigger, if specified. The purpose of the trigger is to replicate the creation of records to another database.
REPLICATION-
DELETE
Specifies the trigger that executes immediately following the execution of the DELETE trigger, if specified. The purpose of the trigger is to replicate the deletion of records to another database.
REPLICATION-
WRITE
Specifies the trigger that executes immediately following the execution of the WRITE trigger, if specified. The purpose of the trigger is to replicate updated records to another database.

For more information about replication, see the chapter on data replication in the Progress Database Administration Guide and Reference.

Press PUT to display the trigger code. Figure 9–4 shows an example of a delete trigger procedure.

Figure 9–4: Trigger Code Dialog Box

Table String Attributes Option

Choose the String Attributes option to control how much space Progress allocates within an r-code text segment for a string. It is important when you translate a string that you specify enough space for the translated string. String attributes can also specify the text justification within the r-code and whether or not the Translation Manager should translate the string. When you choose the String Attributes button, the Table String Attributes dialog box shown in Figure 9–5 appears.

Figure 9–5: Table String Attributes Dialog Box

This dialog box contains the following user-interface elements:

Label

Specifies the string attribute characters for the table label.

Validation Message

Specifies the string attribute characters for the table validation message.

Use the following syntax to enter the string attribute label:

[ R | L | C | T ] [ U ] [ max-length ] 

Table 9–3 describes the string attribute control characters you can enter in the label field.

Table 9–3: String Attribute Characters 
Character
Description
R
Specifies to right justify the string.
L
Specifies to left justify the string.
C
Specifies to center the string.
T
Specifies to remove trailing spaces during string display. Progress does not physically remove the spaces from the string, but replaces them with null values. Progress does not display null values.
U
Indicates that the Translation Manager and the compiler should not translate the string.
max-length
Specifies the amount of space allocated for the text segment. You can specify a number from 1 to 999.

You can specify the characters in any order but can only use each character once. Also, you cannot use any of the letters in conjunction with each other, except for U. If you do not specify the maximum length, Progress uses the length of the original string.

If you do not specify justification, the Progress Compiler left-justifies the string by default, unless the string is a column label. If the string is a column label for a decimal or integer column or a side label, it is right justified.

Table 9–4 lists several examples of string attributes.

Table 9–4: String Attribute Examples 
Example
Meaning
L15
Specifies a width of 15 characters within the r-code text segment and left-justifies the string within the allocated space.
15R
Specifies a width of 15 characters within the r-code text segment and right-justifies the string within the allocated space.
T20
Specifies a width of 20 characters and trims the leading and trailing spaces within the allocated space.
UC20
Specifies a width of 20 characters and centers the string within the allocated space. Also indicates that the Translation Manager should not translate the string.
20RU
Specifies a width of 20 characters and right-justifies the string within the allocated space. Also indicates that the Translation Manager should not translate the string.
30
Specifies a width of 30 characters.

See the Character-String Literal reference entry in the Progress Language Reference for more information about string attributes and string translation.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095