Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nolazybits opened this issue Jun 22, 2016 · 0 comments

Comments

@nolazybits
Copy link

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant