Editing the extractor code
Initial Code: Defining the extractor, connect, extraction, and disconnect methods.
An important operation is connecting to the database using the connect method. The following example illustrates how to do this:
After a connection is established, the extractor needs to prepare the output datasets. The following example illustrates how this is done:
The next step is to manually implement an append operation. With parsers, the ETL automatically renames previously parsed files and calls the parse method to parse new files. In case of an extractor, you need to do this manually.
The logical choice is to use the lastcounter parameter as the timestamp and save it in the DSStatus object. The following example illustrates the code to add before the query:Next, you need to update the lastcounter parameter to the final value of its ts variable ( the maximum timestamp value in the output dataset). The following example illustrates how you can do this:
Last, remember to implement the disconnect method to release (disconnect) the connection. The following example illustrates how to do this:
Where to go from here