I am writing an ETL job in C # using Rhino ETL
I have a database on ServerA. This has 2 tables:
(example)
tblOrder
- OrderID
- CustomerName
- CustomerEmailAddress
- Submitted
tblOrderLine
- OrderID
- Productid
- Productname
- Price
In ServerB, it has an identical table (orders are transferred from the Internet to our backend system)
Using RhinoETL, my InputCommandOperation looks like this:
class ReadOrdersFromWebDB : InputCommandOperation
{
public ReadOrdersFromServerA(ConnectionStringSettings connectionStringSettings)
: base(connectionStringSettings) { }
protected override Row CreateRowFromReader(IDataReader reader)
{
return Row.FromReader(reader);
}
protected override void PrepareCommand(IDbCommand cmd)
{
cmd.CommandText = "SELECT TOP 10 * FROM tblOrders WHERE Transferred = 0";
}
}
Since there are no transformations at this stage, my OutputCommandOperation will look like this:
class WriteOrdersToServerB : OutputCommandOperation
{
protected override void PrepareCommand(IDbCommand cmd, Row row)
{
cmd.CommandText =
@"INSERT INTO etc...........";
}
}
, , tblOrderLine ServerA - , db (join)
"" tblOrderLine InputCommand, .
InputCommand?
?