Assigning Aliases to Tables and Database Fields

From the Database Setup dialog, you can assign an alias, or alternate name, to any table or database field. By using an alias, you can refer to the original table or database field even if the document is set up to refer to it by a different name. By assigning an alias for the table or field name, all references to the table or field are maintained.

For example, suppose you design a sample template for a customer that uses your own database. The fields are as follows:

"Name", "Address", "City", "State", "Zip"

The objects on your template are linked to these field names, as follows:

Text 1 > Database.Name

Text 2 > Database.Address

Text 3 > Database.City

Text 4 > Database.State

Text 5 > Database.Zip

You send the sample template to your customer and ask them to connect it to their own database. Their database contains the same information, but the field names are slightly different, as follows:

"Full Name", "Street", "City", "State"," Zip Code"

If you delete the database that you created and then add the customer's new one, all of the connected text objects will point to field names that no longer exist. For example, Text 1 will still look for the “Database.Name” field, but that field is now called “Database.Full Name”.

Rather than change each linked object to the new database field name, your customer can connect to their own database and then assign an alias that consists of the old database field name to each corresponding new database field, as follows:

"Full Name" has the alias "Name"

"Street" has the alias "Address"

"Zip Code" has the alias "Zip"

There is no need to add an alias to the "City" or "State" fields, because they are the same in both databases.

When a template object looks for the database field that it is assigned to read from, it finds the alias and then retrieves the data from the correct field.

ClosedTo assign an alias to a table

  1. Open the Database Setup dialog. To do this, click Database Connection Setup on the File menu. Alternatively, use any of the other methods that are listed in the Database Setup Dialog help topic.

  2. In the navigation pane, click Tables.

  3. Under Alias, click in the field of the table to which you want to assign an alias.

  4. Enter an alias for the table, and then click OK.

ClosedTo assign an alias to a database field

  1. Open the Database Setup dialog. To do this, click Database Connection Setup on the File menu. Alternatively, use any of the other methods that are listed in the Database Setup Dialog help topic.

  2. In the navigation pane, click Fields.

  3. Under Alias, click in the field of the database field to which you want to assign an alias.

  4. Enter an alias for the field, and then click OK.

Related Topics