New feature: Allow different connection-id in onerror element

I’d like to announce a minor improvement which was requested by several people. It is now possible to use connection-id in <onerror> elements. Few examples:

Example of how to use onerror to emulate CREATE TABLE ... IF NOT EXISTS:
Drops a table if it already exists and then call CREATE again (retry=true).
<script connection-id="in">
    CREATE TABLE Table1;
    <onerror message=".*Table already exists*" retry="true">
        DROP TABLE Table1;

Example of how to log all errors in the script using a custom Java class
<script connection-id="in">
    INSERT INTO TABLE TableName VALUES (1, 'Value1');
    <onerror connection-id="java">
        //"error" object represents error details (java.lang.Throwable)
        Throwable error = (Throwable)get("error");;

About Fyodor Kupolov
Scriptella ETL founder.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: