/ Published in: XML
This Scriptella ETL script copies all rows from Src_Table to Dest_Table.
Src_Table contains the following columns: id, first_name, last_name
Dest_Table contains the following columns: id, name
The name column of the Dest_Table is produced by a concatenation of first_name and last_name from the Src_Table
This example demonstrates HSQLDB-To-Oracle copy procedure, although it works between virtually any databases.
Src_Table contains the following columns: id, first_name, last_name
Dest_Table contains the following columns: id, name
The name column of the Dest_Table is produced by a concatenation of first_name and last_name from the Src_Table
This example demonstrates HSQLDB-To-Oracle copy procedure, although it works between virtually any databases.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!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>
URL: http://scriptella.javaforge.com