Jive Types & Variables

Data Types

Jive supports a full range of data types: Each data type can have a missing value called null in SQL.

Literal values for each data type:

Most reasonable conversions are supported. All data types can be converted to and from string and to bool. Converting from strings uses the same format as the literal representation above. A quoted string literal can be used for timestamp. For example:
var timestamp test_value = '1995/12/31 23:59:59.999999999'
Additionally, a quoted string literal for float can contain exponental (e) notation. For example,
var float million = '1e+6'

Variables

The var Command is used to create variables. A variable has a data type and a value. The value of a variable is assigned with the set Command. A variable is local to its containing block - a query (select) block, a while block or the entire Jive text (effectively, global). Variables in the outer enclosing block can be referenced unless their name is overridden by a more inner variable definition.

Qualification can be used to reference global variables (using root as the qualifier) and query result variables. Dot (.) is used as the qualifier. Multiple qualifiers descend from the left. Inner qualifiers can be omitted like COBOL.

A variable must contain a value of its defined type, or it must be null. Nulls in Jive are the same as in SQL. Nulls can be passed between Jive and SQL databases. null is a keyword in Jive for a null. For example,

set a = null
A null is also used for uninitialized variables and as the result of syntax or semantic errors. For example,
set x = y
will set x to null when y is undefined.

Variables can also be created with:

Result column variables are readonly.
Copyright © 1996 FFE Software All Rights Reserved WorldWide