Data Types

The query language supports six data types: boolean, integer, number, string, list and curve (see Table 1).

Table 23. Primitive data types.

Type

Sample values

Description

Boolean

true, false

Boolean values represent a logical truth value (true or false). The constants 'true' and 'false' represent these values. Boolean values may be retrieved from a database. Queries are typically based on the results of a boolean expression (e.g. "AREA < 100")

Integer

-1, 0, 23

Integer values are whole numbers in the range of -231 to +231-1. Numeric expressions that mix numbers and integers will yield numbers.

Number

100.0, 1e2, 2.4e-3

The number data type represents double precision numbers in the range +/- (2-2-52)·21023. The smallest positive non-zero value represented by a number is 2-1074. Literal values for numbers consist of a mantissa and an optional exponent. Both the mantissa and exponent may be signed. Numbers can be specified by constants, retrieved from a database column, or calculated by expressions. Numeric expressions that mix numbers and integers will yield numbers.

String

'hello'

The string type represents arbitrary character data. Character values may be specified by constants, retrieved from a database column, or calculated in an expression. Constant strings are enclosed in single quotes (').

List

'a,b,c,d'

list('a','b','c')

list(1,2,3,4,5)

The list type represents a sequence of values.

In the first form lists elements are separated by commas, and all elements are treated as string values. Any additional space characters in the list are considered to be part of the elements. Do not include spaces unless you explicitly intend that the list elements include them, otherwise matching errors may occur.

In the second and third forms lists are composed of sequences of expressions. All expressions in the list must be of the same data type.

Curve

curve('0,0, 10,5, 20,15')

The curve type represents a series of vertices. The argument to the curve function is a literal list of numbers. The list must contain an even number of values. The numbers represent pairs of vertices that represent a curve. The MatrixBuilder supports additional functions that access curve data (Curve, CurveID, Attribute).