Data Types

There are two main types of data in DSQL: scalars and objects. However, DSQL is 'loosely' typed: scalars are automatically converted, and objects share common access methods.

Scalars

scalarexample(s)
string'static'
"I'm $name"
booleanTRUE
FALSE
integer42
float3.1415927

Objects

All objects have fields, which can be accessed with .field. Some objects also have records, accessed with [index].

objectexample(s)field select record select
table <table>Staff</table>
<sql>select * from Staff</sql>
combined with a record selector, gives a column or field; e.g. $staff[0].name, $staff[0].@1 a row or record; e.g. the first employee: $staff[1]
XML <name><given>Etienne</given> <last>Paradis</last></name> child of document element; e.g. $x.given or $x.@1 child of document element; e.g. $x[1] is <given> element
java new java.io.File("myfile") a public field defined only for AbstractList
list [1,"yes",3.2]   list element

New fields can be set arbitrarily to any object, without prior "declaration". For example:

$f = new java.io.File("myfile");
  if($f.isFile()) $f.toprocess = 1;


François Paradis
Last modified: Wed Jun 8 00:19:45 EDT 2005