Skip to content
Guides>Scripting Guide

Scripting Guide

This section explains how to write scripts and stored procedures in SQL using MetaKraftwerk Scripting. MetaKraftwerk Scripting is an extension of MetaKraftwerk SQL that provides support for procedural logic. You can use MetaKraftwerk Scripting to write stored procedures and procedural code outside of a stored procedure. This guide explains how to use MetaKraftwerk Scripting.

Blocks

Learn the basic structure of MetaKraftwerk scripting code.

Using Variables

Declaring and using variables.

Returning a value

Return values ​​from stored procedures and an anonymous block.

Using branching

Control flow with IF and CASE statements.

Using loops

Control flow with FOR, WHILE, REPEAT and LOOP.

Using RESULTSETs

Iterate over the result set returned by a query.

Handling Exceptions

Handle errors by handling and throwing exceptions.

Examples of common use cases of MetaKraftwerk Scripting

Learn examples of MetaKraftwerk Scripting code for some common use cases.