f2s_table_tablespace¶

Applies to: Oracle, Postgre SQL Drivers

Syntax

set_attribute f2s_table_sql_name of {FileNumber} to {variable}
get_attribute f2s_table_sql_name of {FileNumber} to {variable}

Parameter

Description

FileNumber

Number of the file (filename.File_Number)

variable

String variable. Name of the existing tablespace

Description

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 the data tables. To set or get the tablespace name for indexes, use the f2s_index_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 table. The tablespace name CANNOT be changed on an existing table. In addition, the table can only be assigned to an existing tablespace, setting this attribute does not create the tablespace itself.

Getting the tablespace name can be done at any time.

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

Examples

get_attribute

string st1

Get_Attribute f2s_table_tablespace of SalesPerson.File_Number to st1

set_attribute

In this example, a new table, TestFile is created in the same tablespace as the Customer File.

String st1
Handle hNewTable
Integer iColumn

Move 0 to hNewTable

Get_Attribute f2s_table_tablespace of Customer.File_Number to st1
Showln (SFormat("adding to tablespace %1", st1))

Structure_Start hNewTable _f2s_ActiveDriver
  Set_Attribute DF_FILE_PHYSICAL_NAME of hNewTable to "TestFile"

  Move 0 to iColumn
  Create_Field hNewTable At iColumn
  Set_Attribute DF_FIELD_NAME of hNewTable iColumn to "TestFile_Number"
  Set_Attribute DF_FIELD_TYPE of hNewTable iColumn to DF_BCD
  Set_Attribute DF_FIELD_LENGTH of hNewTable iColumn to 6

  Move 0 to iColumn
  Create_Field hNewTable At iColumn
  Set_Attribute DF_FIELD_NAME of hNewTable iColumn to "TestDate"
  Set_Attribute DF_FIELD_TYPE of hNewTable iColumn to DF_DATE

  Move 0 to iColumn
  Create_Field hNewTable At iColumn
  Set_Attribute DF_FIELD_NAME of hNewTable iColumn to "Comment"
  Set_Attribute DF_FIELD_TYPE of hNewTable iColumn to DF_TEXT
  Set_Attribute DF_FIELD_LENGTH of hNewTable iColumn to (8 * 1024)

  Set_Attribute f2s_table_tablespace of hNewTable to st1
Structure_End hNewTable

Related Attributes

Replaces: DF_FILE_TABLESPACE_NAME