Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
add_table_column [2013/07/29 19:06]
admin created
add_table_column [2015/10/14 03:10] (current)
admin
Line 3: Line 3:
 ===== Description ===== ===== Description =====
  
-This functor creates a new column in given table. The position where the new column is inserted determines whether the new column is a key or data column.+This functor creates a new column in the given table. The position where the new column is inserted determines whether the new column is a key or data column.
  
 ===== Inputs ===== ===== Inputs =====
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
-| Table  | [[Table Type|Table]]  | Table where the new column will be created. ​ | +| Table  | [[Table Type]] ​ | Table where the new column will be created. ​ | 
-| Column Name  | [[Name Type|Name]]  | The new column name.  | +| Column Name  | [[Name Type]] ​ | The new column name.  | 
-| Column Type  | [[Table Cell Type|Table Cell]]  | The new column cell type.  | +| Column Type  | [[Table Cell Type]] ​ | The new column cell type.  |
 ===== Optional Inputs ===== ===== Optional Inputs =====
  
 ^ Name ^ Type ^ Description ^ Default Value ^ ^ Name ^ Type ^ Description ^ Default Value ^
-| Column Index  | [[Non Negative ​Int Type|Non Negative Int Type]] ​ | Index representing the position where the column will be inserted. If the index is zero or greater than the last column index, the column is placed as the last table column. ​ | 0  | +| Column Index  | [[Non Negative ​Integer Value Type]] ​ | Index representing the position where the column will be inserted. If the index is zero or greater than the last column index, the column is placed as the last table column. ​ | 0  | 
-| Column Should Be Key  | [[Bool Type|Bool]]  | This flag is meaningful only when the column is created after the last key column and before the first data column. If true, the new column represents a key column, otherwise, it represents a data one.  | True  |+| Column Should Be Key  | [[Boolean Value Type]] ​ | This flag is meaningful only when the column is created after the last key column and before the first data column. If true, the new column represents a key column, otherwise, it represents a data one.  | True  |
  
 ===== Outputs ===== ===== Outputs =====
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
-| Result ​ | [[Table Type|Table]]  | The resulting table containing the new column. ​ |+| Result ​ | [[Table Type]] ​ | The resulting table containing the new column. ​ |
  
 ===== Group ===== ===== Group =====
Line 28: Line 27:
  
 ===== Notes ===== ===== Notes =====
 +
 +This functor adds an empty column of the given type at the given position.
 +
 +**Example:​**
 +
 +Given the table below
 +
 +^ Key1*  ^ Key2*  ^ Value1 ​ ^ Value2 ​ ^
 +| 1  | 2  | 2.2  | 3.1  |
 +| 1  | 3  | 2.1  | 3.1  |
 +| 1  | 6  | 1.2  | 4.2  |
 +| 2  | 2  | 3.2  | 6.1  |
 +
 +adding a column named "​New_Column"​ of type "​Real"​ at position 2 results in
 +
 +^ Key1*  ^ New_Column* ​ ^ Key2*  ^ Value1 ​ ^ Value2 ​ ^
 +| 1  |@#C5D9FF: 0.0  | 2  | 2.2  | 3.1  |
 +| 1  |@#C5D9FF: 0.0  | 3  | 2.1  | 3.1  |
 +| 1  |@#C5D9FF: 0.0  | 6  | 1.2  | 4.2  |
 +| 2  |@#C5D9FF: 0.0  | 2  | 3.2  | 6.1  |
  
 ===== Internal Name ===== ===== Internal Name =====
  
 AddTableColumn AddTableColumn