This scenario describes a four-component job that removes a table index, applies a select insert action onto a table then regenerates the index.
Select and drop the following components onto the design workspace: tAmazonMysqlRow (x2), tRowGenerator, and tAmazonMysqlOutput.
Connect tRowGenerator to tAmazonMysqlOutput.
Using a OnComponentOk connections, link the first tAmazonMysqlRow to tRowGenerator and tRowGenerator to the second tAmazonMysqlRow.
Select the tAmazonMysqlRow to fill in the DB Basic settings.
In Property type as well in Schema, select the relevant DB entry in the list.
The DB connection details and the table schema are accordingly filled in.
Propagate the properties and schema details onto the other components of the Job.
The query being stored in the Metadata area of the Repository, you can also select Repository in the Query type field and the relevant query entry.
If you didn't store your query in the Repository, type in the following SQL statement to alter the database entries: drop index <index_name> on <table_name>
Select the second tAmazonMysqlRow component, check the DB properties and schema.
Type in the SQL statement to recreate an index on the table using the following statement: create index <index_name> on <table_name> (<column_name>)
The tRowGenerator component is used to generate automatically the columns to be added to the DB output table defined.
Select the tAmazonMysqlOutput component and fill in the DB connection properties> either from the Repository, or manually for this specific use only. The table to be fed is named: comprehensive.
The schema should be automatically inherited from the data flow coming from the tRowGenerator. Edit the schema to check its structure and check that it corresponds to the schema expected on the DB table specified.
The Action on table is None and the Action on data is Insert.
Press F6 to run the job.
If you manage to watch the action on DB data, you can notice that the index is dropped at the start of the job and recreated at the end of the insert action.
Related topics: tDBSQLRow properties.