DF_FILE_ALIAS

See Also: Get_Attribute, Set_Attribute, Alias Tables, Alias Tables and DDOs, DF_FILE_LOGICAL_NAME, DF_FILE_PHYSICAL_NAME, DF_FILE_ROOT_NAME, DF_FILE_DISPLAY_NAME

 

In DataFlex revision 17.0, we introduced a new feature, implemented via pbUseDDRelates and Alias_File, which works with this attribute to better support alias table handling in the Studio. Read more about the new feature in Better Alias Table DD Support.
 

 

Indicates whether the table is an alias.

Level

Table

Supported by

All Drivers

Type

Enumeration list, temporary

Access

Read / Write

Values

DF_FILE_ALIAS_DEFAULT, DF_FILE_IS_MASTER, DF_FILE_IS_ALIAS

Remarks

Alias tables are needed when multiple logical tables map to one physical table. In the DataFlex environment an alias is created by placing the same physical table in multiple locations in the filelist. This is done by entering the same physical name (DF_FILE_ROOT_NAME) in the filelist slot while entering different user (DF_FILE_DISPLAY_NAME) and table (DF_FILE_LOGICAL_NAME) names. Alias tables allow a program to use multiple global table buffers for the same physical table. See Alias Tables for a detailed description.

You can define Alias tables in the Studio's Table Explorer. See the Studio documentation for more details here.

DF_FILE_ALIAS allows a program to have multiple open instances of a given table without causing deadlocks against itself. When a table has been opened more than once, one table must have DF_FILE_ALIAS set to DF_FILE_IS_MASTER. Each additional instance of the opened table must have DF_FILE_ALIAS set to DF_FILE_IS_ALIAS.

DF_FILE_ALIAS_DEFAULT indicates that the table is neither an alias nor a master file. This value is the default for this attribute.

This attribute can be only set outside of a Structure_Start ... Structure_End operation.

The recommended placement for the code setting this attribute is in the DataDictionary class (.DD) file, just before the DataDictionary class declaration.

Assuming we make an alias table for the Customer table and name it Cust2, we would place the following code just before the DataDictionary class declaration of the Customer and Cust2 DataDictionaries, respectively.

In the master file DataDictionary (Customer table in this example):

Set_Attribute DF_FILE_ALIAS of Customer.File_Number to DF_FILE_IS_MASTER

Class Customer_DataDictionary is a DataDictionary

    …

In the alias file DataDictionary (Cust2 table in this example):

Set_Attribute DF_FILE_ALIAS of Cust2.File_Number to DF_FILE_IS_ALIAS

Class Cust2_DataDictionary is a DataDictionary

    …