You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This page describes Odysseus Script, a language that allows to run (sequences of) queries in different query languages like Continuous Query Language (CQL) or Procedural Query Language (PQL) and to configure the system.

Structure

Variables

Variables

Control Flows

Commands

Each command in Odysseus Script begins with a hash/number sign (#) followed by its name and, finally, by some parameters (if the command needs some parameters).

Line Protocol Handler
#COMMAND parameter1 parameter2

Normally, one command is executed for its own and has no impact to other commands. However, the #QUERY command needs current settings like the parser, which is set by the command #PARSER or the transformation configuration, which is set by the command #TRANSCFG.

Comments

Comments are defined for single lines by using three slashes

Line Protocol Handler
///this is ignored by the parser

Examples

Control Flows

There are some control flows that allows to define how certain commands are executed.

#LOOP

This control flow allows a simple for-loop, which may be used to execute the same queries or commands two or more times.

Usage

Example

The examples shows a loop that repeats 10 times (i=0 until i<10) and executes the "#RUNQUERY SELECT ..." accordingly ten times. Furthermore, the counter "i" is used within the query, so that each ${i} is replaced by the current value of i from the loop.

Line Protocol Handler
#LOOP i 0 UPTO 10
    #RUNQUERY
    SELECT ${i} AS b, * FROM bid 
#ENDLOOP

 

#IFDEF

With #IFDEF it is possible to check whether a variable exists and was set by #DEFINE or not. This is useful, for example, to run certain queries corresponding to the current setting.

Usage

Example

The example defines a variable called latencyOn and uses the #IFDEF command to use either StandardLatency for the transformation configuration, if latencyOn is set or Standard if it is not set. Obviously, this example uses allways the <then-command>-part (since latencyOn is set), so you may switch to another transformation config by simply commenting the #DEFINE command out so that the <else-commands> are used.

Line Protocol Handler
#DEFINE latencyOn
....
#IFDEF latencyOn
	#TRANSCFG StandardLatency	
#ELSE
	#TRANSCFG Standard
#ENDIF

 

Commands

#PARSER

This command sets the current parser for following commands, e.g. by #QUERY or ADDQUERY. The according parser is used until another parser is set.

Parameters

The parser: Which parsers are available strongly depends on the current system setting and installed features. Normally in the default product, there is "PQL" for Procedural Query Language (PQL) and "CQL" for Continuous Query Language (CQL).

Example

Line Protocol Handler
#PARSER PQL

#QUERY

This command sets the current parser for following commands, e.g. by #QUERY or ADDQUERY. The according parser is used until another parser is set.

Parameters

The parser: Which parsers are available strongly depends on the current system setting and installed features. Normally in the default product, there is "PQL" for Procedural Query Language (PQL) and "CQL" for Continuous Query Language (CQL).

Example

Line Protocol Handler
#PARSER PQL

#TRANSCFG

This command sets the transformation configuration for following commands. The transformation configuration defines how a query is transformed into an executable plan. The transformation configuration that was set is used until another configuration is explicitly set.

Parameters

Example

Line Protocol Handler
#TRANSCFG Standard

 

 

  • No labels