beautypg.com

Multiple source tables into one destination table, Database table to xml file – Wavetronix Command Translator (CMD-DT) - User Guide User Manual

Page 149

background image

148

APPENDIX

Multiple Source Tables into One Destination Table

The many-to-one mapping requires a middle step to run correctly. Follow the steps below

to perform this operation:
1 Create a task with two DB components and one Data component in the middle:

Figure A.5 – Database-to-Data-to-Database Action

2 Set the properties for the start and end DB components as “normal”; the Data compo-

nent does not have any properties.

3 Click on the DB-to-Data action to bring up its properties; you will not need to set the

Database or Table Name properties.

4 For this task, a SQL file must be created (containing a custom SELECT query) to obtain

the necessary columns from the two or more source tables that will be used to populate

the destination table. The text file can be created in any text editor and consists of one

SELECT statement that defines the dataset (see Appendix B).

5 Click the Data-to-DB action and fill in the destination Database and Table Name

fields.

6 Save the task.

Note

In most cases the columns from the source table will not have the same names as
the appropriate columns in the destination table.

To line up these columns use one of the following options:

˽

Alter the SELECT query in the DB-to-Data action to change the names of the columns

to their destination table equivalents (see Appendix B).

˽

Use the Data-to-DB mapping tool to map the source columns (which will need to be

inputted manually into the list on the left) to the destination columns. Create the map-

ping and click Accept.

Using either of these methods will allow the task to complete correctly.

Database Table to XML File

Follow the steps below to create an XML file from a table in the database:
1 Create a new task.