Release 10.1A: OpenEdge Reporting:
Query/Results Administration and Development

> ## Table aliases

> A table alias is another name for an existing table in a Results database. Table aliases allow you to perform self-join operations. A self-join is when you join a table to itself. For example, the demonstration `sports` database contains an Item table. Each record in the Item table describes a particular product in a warehouse. You can define an additional field in the Item table to store the item number of a substitute for each item. Once you create the preconditions for the self-join in the schema, you can establish an alias in Results for the Item table called Sub–Item and then join Items with Sub–Items in a Results query.

> | To display the Table Alias dialog box and define an alias for a table, choose Query Site Admin Table Aliases. The Table Alias dialog box appears:

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

> Name

> Specifies the alias for the selected table.

> Tables

> Lists the names of all tables available to your user ID in Results from the connected databases.

> Aliases

> Lists the names of existing aliases. When you select an alias from the list, Results highlights the associated table.

> ##### Relationship buttons

> The Table Alias dialog box contains these buttons and check boxes that perform the actions specified:

> - Add — Adds the specified alias in the Name field to the Aliases selection list.

> - Remove — Removes the currently selected alias.

> - RelateAalias to Table — Specifies whether to create a self-join relationship between the alias and the selected table. This option is activated by default.

> - Copy Relationships — Specifies whether the existing table relationships of the selected table also become the defined relationships for the alias. This option is activated by default.

> | To create a new alias for a table:

> 1. Type the name of a new alias in the Name field. The alias name must be unique among all table names and other alias names.

> 2. Select a table from the Tables list to associate with the new alias.

> 3. As necessary, deselect the Relate Alias to Table toggle box. This option is selected by default.

> 4. If desired, deselect the Copy Relationships toggle box. This option is selected by default.

> 5. Choose Add to create the alias. The new alias appears in the Aliases list.

> Results stores alias definitions in the current `QC7` file when you choose OK and close the Table Alias dialog box.

> Note: You can create several aliases for a single table, but you cannot create an alias for an alias.

> Once you define an alias for a table, the alias appears as a table in every table listing in Results, and you can create queries that use the alias.

> | To restrict user access to the alias, choose Query Site Admin Table Data Selection.

> If you remove an alias that is used in a query, the query will no longer work. If you delete a table, all associated aliases are also deleted. For more information about restricting user access to tables and aliases, see the "Table data selection" section .

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