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;
    </onerror>
</script>

<--
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");
        com.app.ApplicationLogger.logEtlError(error);
    </onerror>
</script>
Advertisements