Versions Compared

Key

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

...

First, the name, which must be after the #PROCEDURE in the same line, is defined. After that, there might be an ordered list of variables. The order is important! These variables will be used as the parameters. Finally, there can be any Odysseus-Script code including queries etc. between the BEGIN and END. The only exception are "global" variables. Between BEGIN and END, only variables are allowed that are defined before (after the procedure name). You can execute the procedure by using the #EXECUTE command.

There cannot be installed more than one procedure with the same name, so you may or delete a procedure by calling #DROPPROCEDURE before.

 

Example

The example creates a procedure with name "setSomething" and has two parameters (varX and attribute). Remeber, order is important! The procedure calls a #RUNQUERY-Command including both parameters. See #EXECUTE command how this example is used.

...

You can create the procedure by using the #PROCEDURE command or delete a procedure by calling #DROPPROCEDURE

 

Example

The example creates a procedure with name "setSomething" and has This example concludes the one from #PROCEDURE. Therefore we have two parameters (varX and attribute). Remeber, order is important! The procedure calls a #RUNQUERY-Command including both parameters. See #EXECUTE command how this example is used.The following executes the

Code Block
themeEclipse
languagejavascript
linenumberstrue
#PROCEDURE#EXECUTE setSomething
varX
attribute
BEGIN
    #RUNQUERY
    SELECT 1 AS a, 2 AS ${attribute}, * FROM bid WHERE b>${varX}
END(1, b)

 

Commands

#ADDQUERY

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

...