Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The structure of an Odysseus Script may contain different things: commands, comments, variables, constants, macros or control flows.

Commands

...

Constants are varibales that exists without defining them explicitly. For example, a default variable is NOW so that ${NOW} can be used to get the current time in millis. This is might be useful if the time of the script execution is needed (e.g. for filenames).

Procedures and Macros

Procedures and macros gives the user a possibility to reuse a certain snippet of the code. They can be distinguished between parameterizable procedures and simply reusable macros. Another advantage: Procedures (#PROCEDURE) are stored in the data dictionary so that their availablity is (according to the user's rights) system wide.

Control Flows

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

...

Stored Procedures and Macros

Stored procedures and macros allows to reuse written Odysseu Script.

#PROCEDURE#PROCEDURE

The #PROCEDURE allows to create stored procedures that are saved into the data dictionary and can be reused by any other scripts, see #EXECUTE how to run them.

...

...

This example concludes the one from #PROCEDURE. Therefore we have two parameters (varX and attribute). The following executes the "setSomething" procedure and sets varX=1 and attribute=b.

Code Block
themeEclipse
languagejavascript
linenumberstrue
#EXECUTE setSomething(1, b)

The variables are replaced and the according Odysseus Script of the procedure is executed at this point. Therefore, the following is inserted insted of the #EXECUTE command:

Code Block
themeEclipse
languagejavascript
linenumberstrue
    #RUNQUERY
    SELECT 1 AS a, 2 AS b, * FROM bid WHERE b>1

Since this snippet is simply inserted, all things of the surrounding Odysseus Script is taken. In our example, this is for example, the choosen #PARSER and #TRANSCFG that are necessary for #RUNQUERY here. Therefore, it is not guaranteed that a procedure is executable of its own.

 

#DROPPROCEDURE

The command can be used to remove stored procedures, which were created by using the #PROCEDURE (see for more information about procedures) command.

Usage

You can create the procedure by using the #PROCEDURE command or execute a procedure by calling #EXECUTE

 

Example

This example concludes the one from #PROCEDURE. Therefore, we want to remove the "setSomething" procedure:

Code Block
themeEclipse
languagejavascript
linenumberstrue
#DROPPROCEDURE setSomething

Commands

#ADDQUERY

This command executes a query in a certain langauge and is equal to #QUERY

...

Example

The first variable is called "one" and has no value. The second variable is called "two" and has the value "1234". See at Variables or at #IFDEF for examples how to use a variable.

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
/// query sharing off
#DOQUERYSHARING false
/// query sharing on
#DOQUERYSHARING true

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
/// query rewrite off
#DOREWRITE false
/// query rewrite on
#DOREWRITE true

...

Parameters

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#DROPALLQUERIES

...

Parameters

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#DROPALLSINKS

...

Parameters

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#DROPALLSOURCES

...

Example

This example changes the user to "System" with password "manager"

...

Parameters

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#LOGOUT

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#ODYSSEUS_PARAM scheduler_TimeSlicePerStrategy 10

...

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

Code Block
themeEclipse
languagejavascript
linenumberstrue
#PARSER PQL

...

If #QName is defined before, the query will get this name.

Example

The example shows four queries after the parser is set to CQL and the transformation configuration is set to Standard. The first one uses #QUERY and it is executed as a CQL-Query, but not started. The second query is equal to the first one (it still uses CQL and is not started). The third query also uses CQL and the Standard transformation configuration, but is (in contrast to the first and second) started (it is directly running). Then, the parser is switched to PQL, so that the fourth query is parsed by the PQL-Parser and not  by the CQL-Parser anymore.

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#RELOADFROMLOG

...

Example

Uses the "Single Thread Scheduler" with a "Round Robin" scheduling strategy

...

Example

Waiting 2 seconds (2000 milliseconds) until the next command is invoked.

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#STARTQUERIES

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#STARTSCHEDULER

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#STOPSCHEDULER

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#TRANSCFG Standard

...

Example

Code Block
themeEclipse
languagejavascript
linenumberstrue
#TRANSCFG Standard

...