Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
This repository was archived by the owner on May 19, 2025. It is now read-only.

Example https://github.com/scriptella/scriptella-examples/blob/master/javascript/etl.xml#L40 #26

@nolazybits

Description

@nolazybits

Hello,

I am trying to achieve exactly what is demonstrated in the example
https://github.com/scriptella/scriptella-examples/blob/master/javascript/etl.xml#L40

but it seems that the variable I get is never the modified one :/

<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
    <properties>
        MYSQL_SERVER=<ip>
        MYSQL_DATABASE=<database>
        MYSQL_USER=<username>
        MYSQL_PASSWORD=<password>
    </properties>

    <description>
        Retreive all the tenants and export to a json file
    </description>

    <!-- Connect to the database -->
    <connection id="DB" url="jdbc:mysql://$MYSQL_SERVER/$MYSQL_DATABASE" user="$MYSQL_USER" password="$MYSQL_PASSWORD" />
    <!-- javascript scripts -->
    <connection id="js" driver="script" />   
    <connection id="log" driver="text"/> <!-- For printing debug information on the console -->

    <query connection-id="DB">
        SELECT * FROM `my_table` ORDER BY login_id;

        <query connection-id="js"> 
            <![CDATA[
                java.lang.System.out.println(name); // output DEFAULT VALUE
                name='NEW NAME'; //Set a transformed value
                java.lang.System.out.println(name); // output NEW NAME
                query.next(); //Don't forget to trigger nested scripts execution
            ]]>

            <script connection-id="log">
                Transformed to $name // output DEFAULT VALUE
            </script>
        </query>
    </query>

</etl>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions