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

Using environment variables #33

Open
michalhabala opened this issue Jun 3, 2020 · 2 comments
Open

Using environment variables #33

michalhabala opened this issue Jun 3, 2020 · 2 comments

Comments

@michalhabala
Copy link

Don't know if this is the right place to ask but I'll try: Is there a way how to use environment variables in ETL scripts?

@newnewcoder
Copy link

newnewcoder commented Nov 21, 2020

Do you mean System.getenv()?

You can use the appropriate connection driver to set what you need as follows:

<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
    <connection id="java" driver="janino"/>
    <connection id="log" driver="text"/>
    <query connection-id="java">
        set("PATH", java.lang.System.getenv("PATH"));
        next();
        <script connection-id="log">
            ===
            $PATH
            ===
        </script>
    </query>
</etl>

@michalhabala
Copy link
Author

This will probably do the trick, thank you!
I was hoping to use something more straightforward directly in the element, but this is also usable, I'm going to test it.

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

2 participants