Skip to main content

TableSelect

The TableSelect function returns a collection of rows according to the specified condition.

Prototype

    TableSelect(Table ; Where ; OrderBy)

Arguments

    Table       String      By value   

Contains a variable of type table or a valid string containing the name of an AF table or an attribute value of type data table.

Where String By value

A valid string containing a Where Clause (C# DataTable select format).

Where can be empty.

OrderBy String By value

A valid string containing one or more column names, comma separated.

OrderBy can be empty.

Returns

    Data Table

Exception

    Undefined

Undefined is returned if:

- Table is empty, or Undefined or not a valid String
- Where is not a valid SQL statement
- OrderBy is not a valid SQL statement

Examples

    TableSelect('SF_Component table' ; 'Component=\'C6+\'' ;)

This will return all rows for the AF Table [SF_Complnent table ]where the [Component ]column is equal to the string value [\'C6+\'].

    TableSelect("i_CompositionTrackingResults"; 'Material=\'C3\''; '')

This will all rows from the data table recorded in the [i_CompositionTrackingResults] attribute where the [Material ]column is equal to the string value ['C3'].