Data Federator- Merging two source tables

Hi,
I have two identically structured source tables and i need to merge them together to a target table.
For Example:-
Source Table1=  { (A,10), (B,11), (C,12) }
+
Source Table2=  { (D,15), (E,16), (F,17) }
Target Table=  { (A,10), (B,11), (C,12), (D,15), (E,16), (F,17)}
Can you please help on how achieve this in data federator.
Thanks in advance.

For Merge - Create a target table with your desired end columns A - E.  Create 2 seperate mappings and map the respective columnns from each source.
For Join - Create a target table with your desired end columns A - E.  Create 1 mappings and map the respective columnns from each source and also creating the necessary relationship between tables.

Similar Messages

  • How to configure GG to merge two source tables into one destination table?

    I have two tables at source (say S1 & S2), I want to merge these tables and replicate to a single target table (Say T1).
    Does GG support this type of replication? If so, could any one let me know how to configure Table and Map parameters?
    Thanks in advance.

    It is possible. In the extract capture both the tables.
    Extract parameter
    table s1;
    table s2;
    Replicat parameter
    map s1, target t1, keycols (...);
    map s2, target t1, keycols (...)

  • Merge multiple source table dates and to one target table

    The requirement is to merge multiple source tables (each table has a set of start and end date) to one target table with one set of start and end date and contain the date relevant column values from each source table.  Payment source tablestart dateend datepayemnt1/1/201512/31/2015301/1/201612/31/999960Position source tablestart dateend dateposition1/1/201512/31/2016101/1/201712/31/999920Target tablestart dateend datepayemntposition1/1/201512/31/201530101/1/201612/31/201660101/1/201712/31/99996020 What transformation(s) will be best to use to handle this requirement? Thanks, Lei

    Thanks Karen,
    that was exactly what i was hoping for.
    Maybe it could be made easier/less confusing if the Mapping Workbench just made you choose a target table. But maybe this is not usefull if the table contains two foreign keys to the same table. Or maybe this should just be put somewhere in the documentation.
    Regards,
    Robert
    Hi Donald,
    fortunately i'm my own DBA so i don't have any problems ;-). However i'm certainly interested in the reasons for not having such a conditional foreign key.
    However actually the foreign key isn't conditional, the condition is that either the field (using the FK) must be filled, or a free-format field. The reasoning for this is that we have a list of known towns and if the addres is local a town from that list must be chosen. If the addres is outside the country a town can just be typed in (no list).
    Concerning the agrregate, all fields are always used. There are no neediness flags anywhere. The aggregate contains three fields which are mapping as direct (two fields) or a One-to-one (the FK). All 'parents' all contains these three fields.
    Regards,
    Robert

  • Join two source tables and replicat into a target table with BLOB

    Hi,
    I am working on an integration to source transaction data from legacy application to ESB using GG.
    What I need to do is join two source tables (to de-normalize the area_id) to form the transaction detail, then transform by concatenate the transaction detail fields into a value only CSV, replicate it on the target ESB IN_DATA table's BLOB content field.
    Based on what I had researched, lookup by join two source tables require SQLEXEC, which doesn't support BLOB.
    What alternatives are there and what GG recommend in such use case?
    Any helpful advice is much appreciated.
    thanks,
    Xiaocun

    Xiaocun,
    Not sure what you're data looks like but it's possible the the comma separated value (CSV) requirement may be solved by something like this in your MAP statement:
    colmap (usedefaults,
    my_blob = @STRCAT (col02, ",", col03, ",", col04)
    Since this is not 1:1 you'll be using a sourcedefs file, which is nice because it will do the datatype conversion for you under the covers (also a nice trick when migrating long raws to blobs). So col02 can be varchar2, col03 a number, and col04 a clob and they'll convert in real-time.
    Mapping two tables to one is simple enough with two MAP statements, the harder challenge is joining operations from separate transactions because OGG is operation based and doesn't work on aggregates. It's possible you could end up using a combination of built in parameters and funcations with SQLEXEC and SQL/PL/SQL for more complicated scenarios, all depending on the design of the target table. But you have several scenarios to address.
    For example, is the target table really a history table or are you actually going to delete from it? If just the child is deleted but you don't want to delete the whole row yet, you may want to use NOCOMPRESSDELETES & UPDATEDELETES and COLMAP a new flag column to denote it was deleted. It's likely that the insert on the child may really mean an update to the target (see UPDATEINSERTS).
    If you need to update the LOB by appending or prepending new data then that's going to require some custom work, staging tables and a looping script, or a user exit.
    Some parameters you may want to become familiar with if not already:
    COLS | COLSEXCEPT
    COLMAP
    OVERRIDEDUPS
    INSERTDELETES
    INSERTMISSINGUPDATES
    INSERTUPDATES
    GETDELETES | IGNOREDELETES
    GETINSERTS | IGNOREINSERTS
    GETUPDATES | IGNOREUPDATES
    Good luck,
    -joe

  • Merge two differents tables in one new structure

    Hello guys,
    How can I merge two differents tables in one new structure (workarea) dynamically?
    For example, merge MARA and MARC in a new structure that contains all fields from MARA and all fields from MARC.
    In this case, it isn't necessary that identical fields be repeated (MATNR).
    Can you help me?
    Thanks!
    Kleber

    Hi,
    Use include structure like:
    data begin of itab occurs 0.
            include structure MARA.
            include structure MARC.
    data end of itab.

  • How to join two Source tables

    Hi
    I am doing a POC on joing two MSSQL 2K source tables and populating into Oracle table.
    I did not find the joiner operator and other transformation operators.
    Can anyone help me in using them?
    Thanks,
    Ganesh

    Hi,
    First, just drag&drop the two source table in the interface.
    Then, connect the two tables with eachother using your mouse while selecting the two columns that you want to use in your join.
    Transformations can be found when selecting a field in your target datastore; you will see a screen appear in the 'properties-panel' of your interface-editor; here you can edit transformations.
    Good luck ...
    Steffen

  • Merge update source table and delete from target table problem

    Hello Friends, 
    I am a newbie in SQL Server world and I am in a situation where I need to delete the bunch of records from the TARGET table using the values from the SOURCE table. 
    The TARGET table has close to 400 Million records, so I need to delete the records in small batches of about ~10,000 rows.
    I figured out a way to delete in batches by refering the following 2 posts
    http://sqlperformance.com/2013/03/io-subsystem/chunk-deletes
    http://dba.stackexchange.com/questions/1750/methods-of-speeding-up-a-huge-delete-from-table-with-no-clauses
    I think my best option to delete and update in 1 pass would be through using Merge statement, so for that I constructed following SQL.
    MERGE dbo.table1 AS TARGET
    USING 
    SELECT File_name FROM dbo.table2
    WHERE  FILE_DESC = 'EDI'
    AND [Processed_date] < DATEADD (WEEK, -10, Getdate ()) AS SOURCE
    ON (TARGET.File_name = SOURCE.File_name)
    WHEN MATCHED THEN DELETE (FROM THE TARGET)
    WHEN MATCHED 
        THEN UPDATE SET SOURCE.PROCESS_delete_date = GETDATE()
    But, when executed, it throws following error and I am struggling to figure out what is wrong with the above syntax. 
    Msg 156, Level 15, State 1, Line 3
    Incorrect syntax near the keyword 'SELECT'.
    Msg 156, Level 15, State 1, Line 5
    Incorrect syntax near the keyword 'AS'.
    Can any expert please help a newbie as I learn the new way.
    Thanks a lot.

    Visakh, we can have more than 1 matched clause in merge as per the Microsoft sql statement, but we need to add a condition along with the match. thanks for your prompt response on this query. your query is logically fine but when executed, it throws
    following error. Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'DELETE'. Msg 102, Level 15, State 1, Line 8 Incorrect syntax near ')'. remember, my server machine is 2005 version & my work machine is 2012. dont know why your query
    is not working.
    MERGE is available only from 2008 onwards
    Yes you're correct but again not more than two  MATCHED clauses even if you specify condition
    see MSDN documentation below
    WHEN MATCHED THEN <merge_matched>
    Specifies that all rows of target_table that match the rows returned by <table_source> ON <merge_search_condition>, and satisfy any additional search condition, are either updated or deleted according to the <merge_matched> clause.
    The MERGE statement can have at most two WHEN MATCHED clauses. If two clauses are specified, then the first clause must be accompanied by an AND <search_condition> clause
    from
    http://msdn.microsoft.com/en-us/library/bb510625.aspx
    Also I guess Composable DML which used is also not present in 2005
    So in your case you can try this instead
    DECLARE @DELETED_FILES table
    File_Name varchar(100)
    DELETE t
    OUTPUT DELETED.File_Name INTO @DELETED_FILES
    FROM dbo.table1 t
    INNER JOIN dbo.table2 s
    ON t.File_name = s.File_name
    WHERE s.FILE_DESC = 'EDI'
    AND s.[Processed_date] < DATEADD (WEEK, -10, Getdate ())
    UPDATE r
    SET r.Process_Delete_Date = GETDATE()
    FROM dbo.table2 r
    INNER JOIN @DELETED_FILES AS p
    ON p.File_Name = r.File_Name
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Merging two internal tables

    Hi,
    I have two internal tables it_tab1 and it_tab2. The fields are,
    it_tab1                        it_tab2
    F1                    F1
    F2                    F2
    F3                    F4
    F6                    F5
    I want to <b>merge</b>(coloumn wise) these two internal tables into a new internal table it_tab3 where it_tab3 has fields,
    F1, F2, F3, F4, F5, F6.(All the fields)
    Here, in it_tab1 and in it_tab2 the fields <b>F1 and F2 are the key fields</b>.The number of records in the two internal tables are different.
    Can anybody help me. thanx for spending ur time.

    hi,
    try this
    hi,
    itab1 - first
    itab2 - second
    itab3 - both
    data l_count type i.
    l_count = 1.
    loop at itab1.
    read table itab2 with key f1 = itab1-f1 f2 = itab1-f2.
    itab3 = itab1
    if sy-subrc is initial
       itab3-field6 = itab2-field3.
       itab3-field7 = itab2-field4.
       append itab3.
    endif.
    endloop.
    loop at itab2.
    itab3 = itab2
    read table itab1 with key f1 = itab2-f1 f2 = itab2-f2.
    if sy-subrc is initial
       itab3-field6 = itab1-field3.
       itab3-field7 = itab1-field4.
       append itab3.
    endif.
    endloop.
    sort itab3 by f1 f2.
    delete adjacent duplicates by comparing f1 f2.
    hope this will solve your problem
    cheers,
    sasi
    Cheers,
    Sasi

  • Data Transfer between two internal tables

    Hi SDN,
    If I have two internal tables itab_a and Itab_b and I want to copy a subset of itab_a to itab_b using a conditional statement, is it possible and how?
    Second, what if I want to append the smaller internal table itab_b to itab_a, how would you do that.
    My task is to take some of the rows from a into b, change one field and append back to a. So if a had 100 rows, now it would have 110.
    Please help.
    Thanks.
    Saf.

    If I have two internal tables itab_a and Itab_b and I want to copy a subset of itab_a to itab_b using a conditional statement, is it possible and how?
    LOOP AT ITAB_A.
      IF ITAB_A-SOME_FIELD = SOME_VALUE.
         MOVE-CORRESPONDING ITAB_A TO ITAB_B.
         APPEND ITAB_B.
      ENDIF.
    ENDLOOP.

  • Merging two separate Tables into One - different number of rows

    Hi. I have a problem. Oracle 10.2.0.4.0
    7 years ago when i was learning how to query my teacher told me that is possible to creata some kind of report where results could be combined in 1 view(report) witch in different variable could have different number of rows.
    I just remember that there is needed to use group by function and some join?
    Please help
    In link there is a sample sample view
    I need to combine Table A using D variable with Table B to become Wynik(result)
    Tables create
    CREATE TABLE "TABELA_A" ( A NUMBER,B NUMBER,C NUMBER,D NUMBER ) ;
    INSERT INTO "TABELA_A" (A, B, C, D) VALUES (123, 1, 70, 999)
    INSERT INTO "TABELA_A" (A, B, C, D) VALUES (123, 2, 80, 999)
    INSERT INTO "TABELA_A" (A, B, C, D) VALUES (234, 1, 100, 111)
    INSERT INTO "TABELA_A" (A, B, C, D) VALUES (456, 1, 10, 222)
    CREATE TABLE "TABELA_B" ( D NUMBER,E VARCHAR2(255),F NUMBER ) ;
    INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'A', 1);
    INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'B', 1);
    INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'B', 3);
    INSERT INTO "TABELA_B" (D, E, F) VALUES (999, 'C', 1);
    INSERT INTO "TABELA_B" (D, E, F) VALUES (111, 'A', 1);
    INSERT INTO "TABELA_B" (D, E, F) VALUES (111, 'C', 2);
    And to become result - in picture
    [http://i303.photobucket.com/albums/nn153/katanbutcher/pytanko.jpg?t=1306152636]
    Thank's for help
    Edited by: 860710 on 2011-05-23 05:42
    Edited by: 860710 on 2011-05-23 05:54
    Edited by: 860710 on 2011-05-23 06:07

    Maybe if you follow the instructions mention in this post you may get some help. For example, I wouldn't try to click on the link provided by you.
    SQL and PL/SQL FAQ
    Regards
    Raj

  • Data Federator Universe Date Functions

    Hi,
    I created a Data Federator Universe from target tables (Source Tables from: Sql Server 2005 and Oracle 10g). Now, I want to create a object in the universe: "Days between 2 dates"(coming from 2 different target tables). I don't see any other date functions other than CURDATE(). How to create my object?
    Alternatively, Can I create a caliculated column in the existing target table? For Example, I want to create a new column "Days between 2 Dates" from 2 different tables by using a formula in Default mapping of the target table.
    Thanks & Regards,
    Peter

    Hi Amit,
    Thanks for your reply.
    Ok. So, Universe on top of Data Federator has limited functionality.
    And, other option you mentioned is on report level. I am creating an adhoc universe and I have few objects which will calculate days between 2 dates coming from 2 different tables.
    But, how can I achieve this on Data Federator level. I have no function there to find Days Between 2 dates. I see lot of time and date functions but not the one I required. Also, I added a column in the target table and tried to apply the formula there in the default mapping area. But, I see only the selected target table. I need another date column from another table, which is not displayed in the default mapping area.
    How can I achieve this?
    Regards,
    -Peter

  • Data Federator Destination

    Hi... we just started using Data Federator in our project.
    I know that using ew could combine Data from multiple Source systems (such as SAP BI, SAP R/3, Oracle, Flat Files a.s.o) and create a semantic layer (Structure).
    Could anyone tell us if the destination from Data Federator be >> a) BO- Universe and                                                                               
    b) SAP BI
    - Anil

    Hi,
    Data federator creates the virtual table for the result set, you can create a BO Universe by providing the JDBC connections details of the DF project but i am not sure about SAP BI.
    Regards,
    Ramu.

  • Data Federator with BW 3.5

    Hi Experts,
    We are using Data Federator and connected to our Client BW 3.5 Oracle Data base directly.
    We were looking to connect to below Cube and Ods tables
    InfoProviders Table Names
    InfoCube ZSD_BILDP /BIC/EZSD_BILDP, /BIC/FZSD_BILDP
    ODS Object ZDP_O04 /BIC/AZDP_O0400
    ODS Object ZDP_O03 /BIC/AZDP_O0300
    ODS Object ZDP_O02 /BIC/AZDP_O0200
    ODS Object ZDP_O01 /BIC/AZDP_O0100
    But we are not able to see the above tables in Data Federator and all the tables we are seeing is
    SAPBIW.?22FBIO?22fsMAT_ITEM
    SAPBIW.?22FBIO?22fsMAT_PLANT
    Can you suggest how can I see the Cube and Ods Tables directly in DF Designer???
    P.S: I did worked with DF in BI 7.0 with my previous Client and it has got the RSDRI_DF_* Functional Modules in SE37, but to new Client we have requirement to use DF with BW3.5 which is becoming troublesome to get to Cube and Ods tables.

    Hi Ingo,
      Thanks for responding.
      We are directly connecting to BW Oracle Data Base and not the BW/BI integration as we don't have the DF* Functional
      Modules present in BW 3.5
    Find below couple of Connection Parameters using which I am connecting to BW from DF Designer.
    Data Source Type -- Oracle
    Defined resource -- jdbc.oracle.oracle10
    Host name        -- xxx.xx.xxx.xx(not specifying here due to security)
    Port             -- 1xxx
    SID              -- XXX
    Table types TABLE and VIEW
    Thanks,
    Suresh

  • How to CREATE VIEW to merge two tables each of which has CLOB-typed column

    I failed in creating a view to merge two tables that have CLOB-type column each.
    The details are:
    Database: Oracle 9i (9.2.0)
    Two tables "test" and "test_bak", each of which has the following structure:
    ID Number(10, 0)
    DUMMY VARCHAR2(20)
    DUMMYCLOB CLOB
    The following operation fails:
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test
    union
    select id, dummy, dummyclob from test_bak;
    I was announced:
    select test.id, test.dummy, test.dummyclob
    ERROR in line 2:
    ORA-00932: inconsistent data type: required - , but CLOB presented.
    But if creating views from only ONE table with CLOB-type columns, or from two tables WITHOUT CLOB-typed columns, the creation will succeed. The following 1) and 2) will succeed, both:
    1) one table, with CLOB-typed column
    create view dummyview (id, dummy, dummyclob) as
    select id, dummy, dummyclob from test;
    2) two tables, without CLOB-typed columns
    create view dummyview (id, dummy) as
    select id, dummy from test
    union
    select id, dummy from test_bak;
    I want to merge the two tables all, with complete columns, how to write the CREATE VIEW SQL statement?
    many thanks in advance

    Dong Wenyu,
    No.
    But you could do this:
    SELECT source.*, nvl (tab1.clob_column, tab2.clob_column)
    FROM your_table1 tab1, your_table2 tab2, (
    SELECT primary_key, ...
    FROM your_table1
    UNION
    SELECT primary_key, ...
    FROM your_table2
    ) source
    WHERE source.primary_key = tab1.id (+)
    AND source.primary_key = tab2.id (+)
    In other words, do the set operation (UNION (ALL)/INTERSECT/MINUS) on just the PK columns before pulling in the LOB columns.
    d.

  • MERGE error : unable to get a stable set of rows in the source tables

    Hi,
    For an update, the following MERGE statement throws the error-unable to get a stable set of rows in the source tables:
    MERGE INTO table2t INT
    USING (SELECT DISTINCT NULL bdl_inst_id,.......
    FROM table1 ftp
    WHERE ftp.gld_business_date = g_business_date
    AND ftp.underlying_instrument_id IS NOT NULL) ui
    ON ( ( INT.inst_id = ui.inst_id
    AND g_business_date BETWEEN INT.valid_from_date
    AND INT.valid_to_date
    OR ( INT.ric = ui.ric
    AND g_business_date BETWEEN INT.valid_from_date
    AND INT.valid_to_date
    OR ( INT.isin = ui.isin
    AND g_business_date BETWEEN INT.valid_from_date
    AND INT.valid_to_date
    OR ( INT.sedol = ui.sedol
    AND g_business_date BETWEEN INT.valid_from_date
    AND INT.valid_to_date
    OR ( INT.cusip = ui.cusip
    AND g_business_date BETWEEN INT.valid_from_date
    AND INT.valid_to_date
    WHEN MATCHED THEN
    UPDATE
    SET INT.inst_id = ui.inst_id, INT.ric = ui.ric
    WHEN NOT MATCHED THEN
    INSERT (inst_key, ......)
    VALUES (inst_key, ......);
    To determine the existence of a record, first check if any match is found on the first key, if not then search for the second key and so on.
    Now two records with differenct first key, i.e. inst_id, can have the same ric(second key). On a rerun, with the target table already populated, the code fails. The reason is it finds duplicate entries for the second key.
    Any suggestions on how to make this work?
    Thanks in advance.
    Annie

    Annie
    You've spotted the problem (that two records have the same RIC). MERGE doesn't allow that; each record in the data being updated is only allowed to be updated once.
    Is there a PK column (or columns) that we can rely on?
    What you can try is to outer join FTP to INT. Something like:
    MERGE INTO INT int1
    USING (
        select columns_you_need
        from (
            select ftp.columns -- whatever they are
                   , int2.columns
                   , row_number() over (partition by int2.pk_columns order by int2.somecolumns) as rn
            from   ftp
            left join int int2
            on (the condition you used in your query)
        where rn=1
    ) s
    WHEN MATCHED THEN UPDATE ...
    WHEN NOT MATCHED THEN INSERT ...So if you can restrict the driving query so that only the first one of the possible updates actually gets presented to the MERGE operation, you might be in with a chance :-)
    And of course this error is nothing to do with any triggers.
    HTH
    Regards Nigel

Maybe you are looking for

  • Creating a Photo Album In Dreamweaver MX 2004

    I followed the steps to create a web photo album using Dreamweaver MX 2004 and Fireworks and it creates it. However, I can't get it to display on the web when I upload it. It displays the message "Page can not be found". Please help!

  • Oracle 10g Enterprise manager  Solaris 9 (Rman backups)

    Hi Guys, I changed the OS and oracle user's password on my database server and OS user on the backup server and since then my rman backups don''t run. What could be the reason because when I click on the Disk Test Backup it says I must supply the Hos

  • FIFO valuation in Group Currency

    Hi Experts, In our client Materail Ledger is activated. Balance Sheet Valuation Inventory on FIFO was activated. at present we have no problem to execute the FIFO valuation and getting the results for currency 10, i;e., company code currency. At pres

  • Solaris 10 LDAP Client: libsldap: Status: 4

    Hi everybody. I changed the configuration in Solaris 10 to restrict the LDAP users who can login to the system. What I have done is changed the value: NS_LDAP_SERVICE_SEARCH_DESC= passwd:ou=people,dc=sis,dc=personal,dc=net,dc=py?sub?host=<hostname> W

  • House Bank Account Number

    Hi, I would like to know if there is  any way i can change the Account Number from House Bank Account Screen? Regards Grayson