file name pattern based on a current day. The produced files have the following naming format:
TABLE_NAME_MM_DD_YYYY.csv
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd"> <etl> <properties> <!-- Configure table name --> table_name=test </properties> <connection id="in" driver="auto" url="jdbc:oracle:thin:@localhost:1521:ORCL" classpath="ojdbc14.jar" user="scott" password="tiger"/> <connection id="out" driver="csv" url="${table_name}_${etl.date.now('MM_dd_yyyy')}.csv" /> <query connection-id="in"> <!-- Query table rows --> SELECT * FROM ${table_name} <script connection-id="out"> <!-- Export each row into a CSV --> $ID, $Name, $Surname <!-- Use column names from selected table --> </script> </query> </etl>
Use Scriptella ETL to run the example.
See How to execute an ETL file from command line, Ant or directly from Java .