DriveWorks Solo 15: TableSelectColumns [send feedback...]

TableSelectColumns

Retrieves the columns from the given table in the specified order, and returns the result.

Syntax

TableSelectColumns([Table] As Table, [Collection of Columns] As Double)

Where:

Table is the table from which to retrieve the columns.

Collection of Columns are the indices of the columns that should be in the result table, these can be in any order, e.g. 3,2,1 to switch the first and third columns around.

Examples

RuleMeaning
TableSelectColumns(DWLookupCustomers,1,3)Will return an array containing the records from columns 1 and 3 from the Customers table.

Example Data

Customers Table

CustomerNameCityCountry
Amazon WarriorsParisFrance
Bolton BurnersConcordUnited States
Boston BullsHanoverGermany
Cambridge CatsToulouseFrance
Dynamo DynamicsIndianaUnited States
Eagle SizzlersMaineUnited States
Everso LuckyVermontUnited States
Forty SomethingsIllinoisUnited States

Example Outcome

Customers Table

CustomerNameCountry
Amazon WarriorsFrance
Bolton BurnersUnited States
Boston BullsGermany
Cambridge CatsFrance
Dynamo DynamicsUnited States
Eagle SizzlersUnited States
Everso LuckyUnited States
Forty SomethingsUnited States

DriveWorks will return the table above as an array, which will look like:

Table returned as an Array
{"CustomerName","Country";"Amazon Warriors","France";"Bolton Burners","United States";"Boston Bulls","Germany";"Cambridge Cats","France";"Dynamo Dynamics","United States";"Eagle Sizzlers","United States";"Everso Lucky","United States";"Forty Somethings","United States"}


Table of Contents