Home arrow Reference arrow Query, Roles
Query, Roles
This function is used to define how the fields returned from the query are to be accepted into the program, which are row labels, which are text columns, which are numeric columns, and which to ignore.

Syntax:

Query, Roles, semicolonDelimitedRoles

Parameters:

semicolonDelimitedRoles – a list of roles for the respective data fields returned from the query, separated by semicolons. Each role may be preceded by a hint followed by an equal sign to help readability.

Examples:

Query,Roles,RowLabel_;Text_;Text_;Numeric_;Numeric_;Ignore_

Load the first returned field from the query as a row label, then two as text columns, two as numeric columns and ignore the last.

Query,Roles,order=RowLabel_;product=Text_;category=Text_; 2006=Numeric_;2007=Numeric_;forecast=Ignore_

To make programming easier, the semicolonDelimitedList can also accept hints so that field names or references can be inserted to help keep track of which field has which role.

Comments:

Note that the number of roles must match the number of fields returned from the query.

Special attention should be made if hints are used, as the hints are ignored and the roles are assigned to the results of the query in the order they appear. It is up to the programmer to keep them in the right order.

Note that if the SQL query returns fields with names starting with RowLabel_, text_ and numeric_ then the fields will be imported as Row Labels, Text Columns and Numeric Columns respectively, making this function unnecessary.

 

Reference

Installation - Java