Editing the extractor code
Example of the extractor code
The following examples sequentially illustrate the initial code that you need to write and then, the other operations that you can perform on extractors.
Write the initial extractor code. Define the extractor, connect, extraction, and disconnect methods.
Connect to the database by using the connect method. Review the following example:
Prepare the output datasets. The extract method is used to perform the query and apply the business logic to the extracted data. Review the following example:
Implement an append operation. With parsers, the ETL automatically renames previously parsed files and calls the parse method to parse new files. In the 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.Update the lastcounter parameter to the final value of its ts variable ( the maximum timestamp value in the output dataset).
Implement the disconnect method to release (disconnect) the connection.