Published in: XML
URL: http://scriptella.javaforge.com
This Scriptella ETL script copies all rows from SrcTable to DestTable. SrcTable contains the following columns: id, firstname, lastname DestTable contains the following columns: id, name The name column of the DestTable is produced by a concatenation of firstname and lastname from the SrcTable This example demonstrates HSQLDB-To-Oracle copy procedure, although it works between virtually any databases.
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd"> <etl> <connection id="in" driver="hsqldb" url="jdbc:hsqldb:file:demo" classpath="hsqldb.jar" user="sa"/> <connection id="out" driver="oracle" url="jdbc:oracle:thin:@localhost:1521:ORCL" classpath="ojdbc14.jar" user="scott" password="tiger"/> <!-- Copy all table rows from one to another database --> <query connection-id="in"> SELECT * FROM Src_Table --Selects all rows <!-- For each row executes insert --> <script connection-id="out"> INSERT INTO Dest_Table(ID, Name) VALUES (?id,?{first_name+' '+last_name}) </script> </query> </etl>
You need to login to post a comment.
