Focal Point
Data Migrator Table Unions (row limit?)

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/9757074136

June 13, 2013, 03:08 PM
cs_source
Data Migrator Table Unions (row limit?)
I have a flow created which has data set which has 2 fairly large tables and i have the flow built as follows:

source1 -> sql (select *) -> union->sql->target
source2 -> sql (select *) -> union->sql->taget

and when i try to test the union i get the following error:

(FOC010) THE NUMBER OF SORT FIELDS EXCEEDS THE MAXIMUM: XXXXX(columnname)
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND
there are about 176 rows and when i cut the columns down to where the the error says (its the 128th row) then it works

Is the best way to go about this to union and pick and choose or am i missing something else, this is raw data and i would prefer to capture it all?
June 17, 2013, 05:59 AM
Martin vK
A 'normal' Union returns a result that contains all rows from both sets with duplicate rows removed. In order to remove the duplicate rows Data Migrator must SORT both input sources, and it is here where you encounter the DM has a maximum of 128 sort fields.

The easiest is if you are sure that the 2 sources do not have duplicate rows, or you do not mind to have those duplicates. In that case change the Union properties to Union Type = Union All

If you do need to remove the duplicate rows there are 2 solutions:
If the Target is loaded as Insert/Update with Update if the record exists, this update will remove the duplicates.

Otherwise I suggest not to use the DataMigrator Union, but make a DBMS SQL flow by which you let the DBMS do the UNION (and remove the duplicates) in stead of DataMigrator.


WebFocus 8206M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
June 18, 2013, 10:11 AM
Clif
There is a DataMigrator UNION object but
DM generates SQL SELECT statements and if possible passes them to the underlying relational database for execution.

That would require that all sources are in the same relational database and the same connection.

In this particular instance hotline learned that the two source tables were two different MS SQL Server databases accessed through different connections. Thus the UNION operation is done in FOCUS and hits the limit.

This can be avoided by creating a Remote View in MS SQL Server in one database for the table in the other. Then from the DMC create a synonym for the VIEW. Now the UNION can be passed to MS SQL Server.


N/A