GetTableFromStore

ITable GetTableFromStore(string inStoreName)

Description

Returns a table object of a subject store (additional data list).

Parameters

The following is a list of parameters the functions receives 

Parameter Type Description
inStoreName string Name of subject store

 

Return Type

ITable

Overloads

List of overloads for this function

ITable GetTableFromStore(string inStoreName, string inColumns, string inWhere, string inOrder)
ITable GetTableFromStore(string inStoreName, string inColumns, string inWhere, string inOrder, string inGroup)

Parameters for overloads:

Parameter Type Description
inStoreName string Name of subject store
inColumns string Column name in SQL
inWhere string Where command in SQL
inOrder string Order command in SQL
inGroup string Group By command in SQL

 

Overload Example

var table = GetTableFromStore("my_store123","city","@@[country]='UK'","");
(*the ‘@@’ is needed from internal system requirements)
The above will return a table with one column (the "city" column), with all the rows from the "my_store123" subject store where the value under the "country" column is 'UK'. That table object returned, will be stored in the "table" variable in the above example.

The Table object is like a Matrix structure (an Array of arrays).

Access to a specific row in the Table object, using the "table" variable from the example above, is done like this: table[<row index>]. For example, table[0] will return the first row. table[1] will return the second row, and so on.

Access to a specific cell in the table object, is done first by accessing the relevant row, and then the relevant column (which will direct us to the actual value stored in that row and column in our table / matrix): table[<row index>][<column index>]. For example, table[2][0] will return the value stored in the cell located in the 3rd row and first column of the table (Remember, rows and columns, indexes are zero-based). 

If referring to the example above, table[2][0] will return the value stored in the 3rd row under the "city" column (as our table object has only one column which is the "city" column). I could access the same cell by using the actual column name instead of its index, like this: table[2]["city"].

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.