Applies to: Oracle, PostgreSQL Drivers


set_attribute f2s_index_tablespace of {FileNumber} {index} to {variable}
get_attribute f2s_index_tablespace of {FileNumber} {index} to {variable}




Number of the file (filename.File_Number)


Integer index to get/set the tablespace


String variable. Name of the existing tablespace.


A tablespace is a container of segments, objects that have an allotted amount of space, i.e. tables and indexes. This attribute is used to get or set the name of the tablespace being used for an index. To set or get the tablespace name for the data tables, use the f2s_table_tablespace attribute.

Setting the tablespace name can only be done during a Structure_Start/Structure_End block (see DataFlex documentation for more information) and only when creating a new index. The tablespace name CANNOT be changed on an existing index. In addition, the index can only be assigned to an existing tablespace, setting this attribute does not create the tablespace itself.

Getting the tablespace name of the index can be done at any time.

Even though MYSQL uses tablespaces, this this attribute is only supported in Oracle and PostgreSQL.

If the index is missing, a error will NOT be thrown and the tablespace will NOT be set.



string st1

Get_Attribute f2s_index_tablespace of Customer.File_Number 1 to st1

set_attribute In this example, a new index (number 4) is created for the customer table. It is set to the same tablespace as the table.

Integer iIndex
String st1
Handle hCustomer

Get_Attribute f2s_table_tablespace of Customer.File_Number to st1

Showln (SFormat("The tablespace is %1",st1))

Move Customer.File_Number to hCustomer

Structure_Start hCustomer _f2s_ActiveDriver
        Move 0 to iIndex
        Create_Index hCustomer At iIndex
        Set_Attribute DF_INDEX_NUMBER_SEGMENTS of hCustomer iIndex to 2
        Set_Attribute DF_INDEX_SEGMENT_FIELD of hCustomer iIndex 1 to 10
        Set_Attribute DF_INDEX_SEGMENT_FIELD of hCustomer iIndex 2 to 1
        Set_Attribute DF_INDEX_SEGMENT_DIRECTION of hCustomer iIndex 1 to DF_DESCENDING
        Set_Attribute f2s_index_tablespace of hCustomer iIndex to st1
Structure_End hCustomer
Open Customer

Get_Attribute f2s_index_tablespace of Customer.File_Number 4 to st1
Showln (SFormat("The tablespace of index 4 is %1",st1))

Related Attributes