The Field Synonym: ALIAS

In this section:

You can assign every field an alternative name, or alias. A field alias may be its original name as defined to its native data source, any name you choose, or, in special cases, a predefined value. The way in which you assign the alias is determined by the type of data source and, in special cases, the role the field plays in the data source. After it has been assigned, you can use this alias in requests as a synonym for the regular field name. Assign this alternative name using the ALIAS attribute.


Top of page

Example: Using a Field Synonym

In the EMPLOYEE data source, the name CURR_SAL is assigned to a field using the FIELDNAME attribute, and the alternative name CSAL is assigned to the same field using the ALIAS attribute:

FIELDNAME = CURR_SAL, ALIAS = CSAL, USAGE = D12.2M,  $

Both names are equally valid within a request. The following TABLE requests illustrate that they are functionally identical, refer to the same field, and produce the same result:

TABLE FILE EMPLOYEE
PRINT CURR_SAL BY EMP_ID
END
 
TABLE FILE EMPLOYEE
PRINT CSAL BY EMP_ID
END

Note: In extract files (HOLD, PCHOLD), the field name is used to identify fields, not the ALIAS.


Top of page

x
Implementing a Field Synonym

The value you assign to ALIAS must conform to the same naming conventions to which the FIELDNAME attribute is subject, unless stated otherwise. Assign a value to ALIAS in the following way for the following types of data sources:


WebFOCUS