Problem with merge

Hi,
I have 2 tables and I would like to insert or update everything from table2 into table1.
That I know how to do, so now the tricky part.
I would like to update a row in table1 if the data is NOT in table2.
f.x.
table1 has the following data:
1, 'test1', '2009-09-04'
2, 'test2', '2009-08-15'
3, 'test3', '2009-08-15'
table2:
2, 'test3', '2009-08-15',
3, 'test2', '2009-08-15'
This should result in table1 looking like this:
1, 'test1', NULL
2, 'test3', '2009-08-15'
3, 'test2', '2009-08-15'
- date on row 1 has been set to null since there is no data with ID 1 in table2
- second field on row2 and row3 has been changed to match that of table2
Thanks
Bjarke

SQL> select * from testing;
COL1                 COL2
test3                3
test2                2
test1                1
SQL> select * from testing1;
COL1       COL2
test3      new3
test2      new2
SQL> update testing set col2 = (select col2 from testing1 where testing1.col1= testing.col1)
  2  ;
3 rows updated.
SQL> select * from testing;
COL1                 COL2
test3                new3
test2                new2
test1check this.
Ravi Kumar

Similar Messages

  • Performance problem with MERGE statement

    Version : 11.1.0.7.0
    I have an insert statement like following which is taking less than 2 secs to complete and inserts around 4000 rows:
    INSERT INTO sch.tab1
              (c1,c2,c3)
    SELECT c1,c2,c3
       FROM sch1.tab1@dblink
      WHERE c1 IN (SELECT c1 FROM sch1.tab2@dblink);I wanted to change it to a MERGE statement just to avoid duplicate data. I changed it to following :
    MERGE INTO sch.tab1 t1
    USING (SELECT c1,c2,c3
       FROM sch1.tab1@dblink
      WHERE c1 IN (SELECT c1 FROM sch1.tab2@dblink) t2
    ON (t1.c1 = t2.c1)
    WHEN NOT MATCHED THEN
    INSERT (t1.c1,t1.c2,t1.c3)
    VALUES (t2.c1,t2.c2,t2.c3);The MERGE statement is taking more than 2 mins (and I stopped the execution after that). I removed the WHERE clause subquery inside the subquery of the USING section and it executed in 1 sec.
    If I execute the same select statement with the WHERE clause outside the MERGE statement, it takes just 1 sec to return the data.
    Is there any known issue with MERGE statement while implementing using above scenario?

    riedelme wrote:
    Are your join columns indexed?
    Yes, the join columns are indexed.
    You are doing a remote query inside the merge; remote queries can slow things down. Do you have to select all thr rows from the remote table? What if you copied them locally using a materialized view?Yes, I agree that remote queries will slow things down. But the same is not happening while select, insert and pl/sql. It happens only when we are using MERGE. I have to test what happens if we use a subquery refering to a local table or materialized view. Even if it works, I think there is still a problem with MERGE in case of remote subqueries (atleast till I test local queries). I wish some one can test similar scenarios so that we can know whether it is a genuine problem or some specific problem from my side.
    >
    BTW, I haven't had great luck with MERGE either :(. Last time I tried to use it I found it faster to use a loop with insert/update logic.
    Edited by: riedelme on Jul 28, 2009 12:12 PM:) I used the same to overcome this situation. I think MERGE needs to be still improved functionally from Oracle side. I personally feel that it is one of the robust features to grace SQL or PL/SQL.

  • Problems with Merging Account

    Hi Experts,
    I have 2 problems with merging accounts:
    1) Opportunity is not moved from source data to master data. I do not know why. Central BP is changable.
    2) Contact Person is only copied, not moved. This causes problems later on when we want to delete the source data.
    Any idea how to solve this?
    Best regards,
    Cristina

    Hi Arno:
    First of all: Thanks for answering my thread!
    The problem with opportunities in my system is, that they are not merged at all, not even with the batch job. I checked trx. BUSWU02. Node CRM370 is assigned to variant CLEAR_REP.
    Also the central Business Partner in opportunity remains changable, once the opportunity was saved.
    Anything else I have to check??
    Best regards,
    Cristina

  • Problem with MERGE statement

    Hi All,
    We are encountering a strange problem with the merge command.
    The following statement works :-
    merge into ATTRIBUTE_GROUP@US_PRODUCT_UAT a
    using
         select
              a1.group_id,
              a1.NAME,
              a1.CREATE_DATE,
              a1.MODIFY_DATE
         from
              ATTRIBUTE_GROUP_LOG a1,
              product_push_wrk a2
         where
              a2.column_id = a1.group_id and
              a2.modify_date = a1.modify_date ) b
    on ( a.group_id = b.group_id)
    when matched then
         update set
              a.NAME = b.NAME,
              a.CREATE_DATE = b.CREATE_DATE,
              a.MODIFY_DATE = b.MODIFY_DATE
    when not matched then
         insert
              a.group_id,
              a.NAME,
              a.CREATE_DATE,
              a.MODIFY_DATE
         values
              b.group_id,
              b.NAME,
              b.CREATE_DATE,
              b.MODIFY_DATE
    However when we change the order of the columns in the select query as follows the an error occurs : -
    merge into ATTRIBUTE_GROUP@US_PRODUCT_UAT a
    using
         select
              a1.NAME,
              a1.group_id,
              a1.CREATE_DATE,
              a1.MODIFY_DATE
         from
              ATTRIBUTE_GROUP_LOG a1,
              product_push_wrk a2
         where
              a2.column_id = a1.group_id and
              a2.modify_date = a1.modify_date ) b
    on ( a.group_id = b.group_id)
    when matched then
         update set
              a.NAME = b.NAME,
              a.CREATE_DATE = b.CREATE_DATE,
              a.MODIFY_DATE = b.MODIFY_DATE
    when not matched then
         insert
              a.group_id,
              a.NAME,
              a.CREATE_DATE,
              a.MODIFY_DATE
         values
              b.group_id,
              b.NAME,
              b.CREATE_DATE,
              b.MODIFY_DATE
    ERROR at line 15:
    ORA-00904: "B"."GROUP_ID": invalid identifier
    SQL> l 15
    15* on ( a.group_id = b.group_id)
    The structure of the attribute_log table is as follows :-
    SQL> desc ATTRIBUTE_GROUP
    Name Null? Type
    GROUP_ID NOT NULL NUMBER
    NAME NOT NULL VARCHAR2(96)
    CREATE_DATE NOT NULL DATE
    MODIFY_DATE NOT NULL DATE
    Any pointers to the cause of this error will be highly appreciated.
    Thanks and Regards,
    Suman

    The table structures are as follows :-
    04:17:17 SQL> desc product_push_wrk
    Name Null? Type
    COLUMN_ID NOT NULL NUMBER
    TYPE NOT NULL VARCHAR2(10)
    PARENT_COLUMN_ID NUMBER
    LEVEL_NO NUMBER
    MODIFY_DATE NOT NULL DATE
    04:17:25 SQL> desc ATTRIBUTE_GROUP_LOG
    Name Null? Type
    GROUP_ID NOT NULL NUMBER
    NAME NOT NULL VARCHAR2(96)
    CREATE_DATE DATE
    MODIFY_DATE DATE
    04:18:02 SQL> desc ATTRIBUTE_GROUP
    Name Null? Type
    GROUP_ID NOT NULL NUMBER
    NAME NOT NULL VARCHAR2(96)
    CREATE_DATE DATE
    MODIFY_DATE DATE

  • ICloud not syncing and Contact problems with merging duplicates

    I was having problems with the syncing of my notes app. When I got the iphone 5 I had since using Mountain Lion I had started to make use of the fact that the notes sync across iCloud. Great. Although not for long. Everything was going fine notes were syncing across devices but then spontaneously they stopped syncing for no apparent reason. I then went to look in settings, looked online and all through discussion forums. Switching notes on and off on icloud both on the macbook and on my iphone. Restarting devices etc etc. iCloud itself online was not able to access the notes app. I kept getting error messages that I would submit to apple. Then I finally relqinquished and unhooked the iCloud accounts from the computer and phone. And at the sacrifice of losing albums in my photostream they sprung back to syncing.
    Then the real problem happened. I had selected to keep a copy of my address book in contacts when I unhooked my computer just in case. When everything linked back up again, I then had duplicates in my address book. Not 1 (this can happen just having icloud active) but 5 sets of duplicates, granted I had kept a version from when I unhooked. So I looked around again for how I could quickly and easily get rid of duplicates. Following suggestions online I go into contacts>cards>look for duplicates. I had 1200 or somthing duplicates, so naturally when given the option "would you like to merge the info in these duplicates I click yes. The MacBook starts to chugg away. Its gonna take a while. So I come back later. And before returning to CONTACTS, go to send a message from MESSAGES and I notice that 80% of the threads have no name. I go back to CONTACTS and WHAM 100s of contacts disappeared in the merge never to be retrieived again. You cant restore CONTACTS from Time Machine as it is just mirrors the contacts that you have in present time. Restoring phone doesn't work becasue it just downloads from iCloud after it has restored. TOTALLY RIDICULOUS. I am livid.

    what I mean is - create a complete new contact on your contacts and select a picture for it from your Mac. Then set it as "make this my card"
    Once you have done that - presumably it will sync with iCloud - have a look and the contact should appear on your iPhone too.
    On your iPhone go on Settings>Mail,Contacts,Calendar> Under "Contacts: in "My Info" select That new contact you created on your Mac.
    Let me know if that works.
    -On another note, so what you are saying is, if I take my 15' Macbook Pro in and they have none of the old ones in stock, they just give you a Retina display one! Did you take it to them for the contact issue you were having or something else?

  • Table cells - Problem with merged cells

    Hi
    I was experiencing very weird behavior with my tables until I realized that it was caused by merged cells
    My script gives a dialog which allows the user to choose from which column to start and from which row.
    As the script iterates through the cells in the selection I was getting weird results
    Through using .select() function I was able to see that depending on the column, some times row 5 could be which seems to be row 3!
    The reason was because of merged cells in that row
    I.e., when some cells are merged together, only the first column of those merged cells is recognized - the others are not
    so it comes out that when merging cells from column 3 to 5, column 3 has a cell in that row, columns 4 and 5 do not, and column 6 does!
    Is there a way to get around this behavior?
    Thanks
    Davey

    I don't understand the point of your post.
    If you're trying to report a problem or "bug" with Pages, that is not the purpose of this user-to-user forum. You should leave feedback for the Pages team on this page.
    I've not had a problem opening Word files with tables in Pages. If you're saying Word can't handle tables with merged cells, then don't use merged cells in files you are going to export as Word. Word & Pages must handle merged table cells differently, as I know both can do that. As far as RTF, Pages can open & export as RTF. Again, if you are going to export as RTF, don't use tables. Neither of these is a fault of Pages, just limitations of the formats/programs.

  • Trimming tool problems with merged clips

    I'm trying to edit a filmstyle sequence with merged clips (created video and audio synched, then merged into new clips). This works fine, except when I try to trim edits in the sequence - the trim tool works, but the picture in the left and right trim windows jump to different parts of the clips being trimmed, and do not show the correct frames being trimmed. The trim tool works fine when used with unmerged clips, but somehow can't seem to work with the synched up clips
    The footage being edited was shot on RED and is in pro rez 4:4:4 format.
    Has anyone else experienced this problem? Is this a bug, or is there a way around this? Thanks for any pointers...

    I created a new user account and trashed my preferences and I have the same problems. I created a new project, and new sequences. Same problems.
    It only happens with 23.98 (batch reverse telecined using Cinema Tools) NTSC DV clips that have been merged with separate 24-bit 48 khz Quicktime audio clips (converted from BWF using BWF2XML). Clips that were captured from the tape with audio and video simultaneously don't have this problem. The discrepancies between the actual amounts trimmed and the white numbers in the trim windows are consistent. If it's off by 6:10 on a clip, every time I try to trim that clip it will be off by the same amount. But the number varies from clip to clip. It's generally 5-8 seconds.
    If I try to trim only the audio, I don't have any trouble. If I trim the audio and video at the same time I don't have any trouble. It's only when I trim the video on its own. If I use the original video clip before it's merged with an audio track then it trims fine. If I cut the merged clip into a sequence then delete the audio track from the sequence the problem remains.

  • Problem with Merge into stmt

    Dears,
    I m using 10g XE.
    I am using merge into stmt, to inesrt non matched records and to update matched records with respect to primary key.
    I have two uers in oracle. (TMP and REAL)
    I have n number of tables with same definition in both users.
    I will always merge all the tables into "REAL" from TMP uesr
    Each and very table may contain more than 200000 records.
    while merging some of the records got deleted from the REAL user which already available in REAL user.
    i.e records available in TEMP.A is not available in REAL.A
    if i re rerun the merge qry once again, the missing records inserted into REAL.A
    how it happens? is ther is any bug with merge into stmt while processing huge amount of rows.
    Sample Qry:
    MERGE INTO REAL.med_stock_sales B
    USING (
    SELECT 1 AS RETAIL_OUTLET_ID,mss_id,MSS_ITEMCODE,MSS_TRAN_DATE,MSS_TRAN_TYPE,MSS_REF_NO,MSS_TRANS_QTY,MSS_FREE_QTY,MSS_PUR_RATE,MSS_SELLING,MSS_TAG,MSS_BNO,MSS_CAT1,MSS_CAT2,MSS_CAT3,MSS_CAT4,MSS_CAT5,MSS_CAT6,MSS_CAT7,MSS_CAT8,MSS_CAT9,MSS_CAT10,MSS_compid,MSS_diviid,MSS_locaid,TS,MSS_BAGS FROM TMP.med_stock_sales) E
    ON (B.RETAIL_OUTLET_ID = E.RETAIL_OUTLET_ID AND B.MSS_ID = E.mss_id )
    WHEN MATCHED THEN
    UPDATE SET B.MSS_ITEMCODE = E.MSS_ITEMCODE , B.MSS_TRAN_DATE = E.MSS_TRAN_DATE , B.MSS_TRAN_TYPE = E.MSS_TRAN_TYPE , B.MSS_REF_NO = E.MSS_REF_NO , B.MSS_TRANS_QTY = E.MSS_TRANS_QTY , B.MSS_FREE_QTY = E.MSS_FREE_QTY , B.MSS_PUR_RATE = E.MSS_PUR_RATE , B.MSS_SELLING = E.MSS_SELLING , B.MSS_TAG = E.MSS_TAG , B.MSS_BNO = E.MSS_BNO , B.MSS_CAT1 = E.MSS_CAT1 , B.MSS_CAT2 = E.MSS_CAT2 , B.MSS_CAT3 = E.MSS_CAT3 , B.MSS_CAT4 = E.MSS_CAT4 , B.MSS_CAT5 = E.MSS_CAT5 , B.MSS_CAT6 = E.MSS_CAT6 , B.MSS_CAT7 = E.MSS_CAT7 , B.MSS_CAT8 = E.MSS_CAT8 , B.MSS_CAT9 = E.MSS_CAT9 , B.MSS_CAT10 = E.MSS_CAT10 , B.MSS_compid = E.MSS_compid , B.MSS_diviid = E.MSS_diviid , B.MSS_locaid = E.MSS_locaid , B.TS = E.TS , B.MSS_BAGS = E.MSS_BAGS
    WHEN NOT MATCHED THEN
    INSERT (B.RETAIL_OUTLET_ID , B.MSS_ID , B.MSS_ITEMCODE , B.MSS_TRAN_DATE , B.MSS_TRAN_TYPE , B.MSS_REF_NO , B.MSS_TRANS_QTY , B.MSS_FREE_QTY , B.MSS_PUR_RATE , B.MSS_SELLING , B.MSS_TAG , B.MSS_BNO , B.MSS_CAT1 , B.MSS_CAT2 , B.MSS_CAT3 , B.MSS_CAT4 , B.MSS_CAT5 , B.MSS_CAT6 , B.MSS_CAT7 , B.MSS_CAT8 , B.MSS_CAT9 , B.MSS_CAT10 , B.MSS_compid , B.MSS_diviid , B.MSS_locaid , B.TS , B.MSS_BAGS )
    VALUES (E.RETAIL_OUTLET_ID , E.mss_id , E.MSS_ITEMCODE , E.MSS_TRAN_DATE , E.MSS_TRAN_TYPE , E.MSS_REF_NO , E.MSS_TRANS_QTY , E.MSS_FREE_QTY , E.MSS_PUR_RATE , E.MSS_SELLING , E.MSS_TAG , E.MSS_BNO , E.MSS_CAT1 , E.MSS_CAT2 , E.MSS_CAT3 , E.MSS_CAT4 , E.MSS_CAT5 , E.MSS_CAT6 , E.MSS_CAT7 , E.MSS_CAT8 , E.MSS_CAT9 , E.MSS_CAT10 , E.MSS_compid , E.MSS_diviid , E.MSS_locaid , E.TS , E.MSS_BAGS )

    Hi
    if i re rerun the merge qry once again, the missing records inserted into REAL.AThat's exactly what you would expect. Your SQL will insert into REAL.med_stock_sales any records that are in the TEMP table but not in the REAL table - assuming the primary key is (RETAIL_OUTLET_ID, MSS_ID). So if you delete records from REAL, they will keep being repopulated from TEMP - and matching records in REAL will be updated from TEMP
    If you want to be able to delete records from REAL without this happening, you have a couple of options:
    1) when you delete from REAL, also delete from TEMP (eg using a trigger). This is simplest.
    2) when you delete from REAL, don't actually delete, just update a DELETED_YN flag
    3) when you delete from REAL, add the primary key to a DELETED_STOCK table. Then change your merge to exclude "deleted" records
    MERGE INTO REAL.med_stock_sales B
    USING (
    SELECT 1 AS RETAIL_OUTLET_ID,mss_id,MSS_ITEMCODE
       ,MSS_TRAN_DATE,MSS_TRAN_TYPE,MSS_REF_NO,MSS_TRANS_QTY,MSS_FREE_QTY
       ,MSS_PUR_RATE,MSS_SELLING,MSS_TAG,MSS_BNO
       ,MSS_CAT1,MSS_CAT2,MSS_CAT3,MSS_CAT4,MSS_CAT5,MSS_CAT6,MSS_CAT7,MSS_CAT8,MSS_CAT9,MSS_CAT10
       ,MSS_compid,MSS_diviid,MSS_locaid,TS,MSS_BAGS
    FROM TMP.med_stock_sales ss
    WHERE not exists (
        SELECT 1 FROM REAL.DELETED_STOCK ds
        WHERE ds.RETAIL_OUTLET_ID = ss.RETAIL_OUTLET_ID AND ds.MSS_ID = ss.mss_id
    ) E
    ON (B.RETAIL_OUTLET_ID = E.RETAIL_OUTLET_ID AND B.MSS_ID = E.mss_id )
    WHEN MATCHED THEN ...Hope that helps
    Regards Nigel

  • Problem with merge using package (row)variable

    We're doing an ETL project, where we have to validate data coming from staging tables before inserting / updating them in our data tables.
    We use a validate function for this, in which we 'test' our mappings and business logic, and returns 'OK' if no errors were occured.This function is called in the WHERE clause, and populates a package row variable. From this variable, values are read in the insert / update statement, using a get function.
    The problem is that sometimes, with a data set with NO duplicate keys, we get an ORA-00001 error, and sometimes not.
    Does anyone have any idea why this error could occur ? We're on Oracle 9.2.0.5.0.
    For the demo mentioned below, the following statement fails , while it succeeds if we add 'and rownum < 11' to the where clause :
    merge into target_tab t
    using (select st.* from source_tab st where demo_pack.assign_var(st.attrib_1, st.attrib_2, st.attrib_3) = 'OK') s
    on (t.attrib_1 = s.attrib_1 and
    t.attrib_2 = s.attrib_2)
    when matched then update
    set t.attrib_3 = demo_pack.get_attrib('ATTRIB_3')
    when not matched then
    insert(attrib_1, attrib_2, attrib_3)
    values (demo_pack.get_attrib('ATTRIB_1'), demo_pack.get_attrib('ATTRIB_2'), demo_pack.get_attrib('ATTRIB_3'));
    Can anyone explain to me why this statement sometimes fails, and other times not ?
    Thanks in advance .
    demo tables / packages :
    create table source_tab
    attrib_1 varchar2(30),
    attrib_2 varchar2(30),
    attrib_3 varchar2(200)
    create table target_tab
    attrib_1 varchar2(30) not null,
    attrib_2 varchar2(30) not null,
    attrib_3 varchar2(200),
    constraint pk_target_tab primary key(attrib_1, attrib_2)
    insert into source_tab
    select table_name, column_name, data_type
    from user_tab_columns;
    commit;
    create or replace package demo_pack as
    function assign_var(p_attrib_1 in target_tab.attrib_1%type,
    p_attrib_2 in target_tab.attrib_2%type,
    p_attrib_3 in target_tab.attrib_3%type) return varchar2;
    function get_attrib(p_name in varchar2) return varchar2;
    end;
    create or replace package body demo_pack as
    g_rec target_tab%rowtype;
    function assign_var(p_attrib_1 in target_tab.attrib_1%type,
    p_attrib_2 in target_tab.attrib_2%type,
    p_attrib_3 in target_tab.attrib_3%type) return varchar2 is
    begin
    g_rec.attrib_1 := p_attrib_1;
    g_rec.attrib_2 := p_attrib_2;
    g_rec.attrib_3 := p_attrib_3;
    return 'OK';
    end;
    function get_attrib(p_name in varchar2) return varchar2 is
    l_return varchar2(200);
    begin
    if p_name = 'ATTRIB_1' then
    l_return := g_rec.attrib_1;
    elsif p_name = 'ATTRIB_2' then
    l_return := g_rec.attrib_2;
    elsif p_name = 'ATTRIB_3' then
    l_return := g_rec.attrib_3;
    end if;
    return l_return;
    end;
    end;
    /

    It's not necessarily that the problem is within your package code. As long as UNIQUE constraint exists on DEST table, any MERGE statement may fail with ORA-00001 due to concurrent updates and inserts taking place.
    Of course, it's just my guess but consider the following scenario (three sessions modify DEST table in parallel – and to keep this example clear, I put their commands in chronological order):
    S#1>  create table dest(x primary key, y) as
      2   select rownum, rownum
      3     from dual
      4  connect by level <= 5;
    Table created.
    S#1>  create table src(x, y) as
      2   select rownum + 1, rownum + 1
      3     from dual
      4  connect by level <= 5;
    Table created.
    S#1> select * from src;
             X          Y
             2          2
             3          3
             4          4
             5          5
             6          6
    S#1> select * from dest;
             X          Y
             1          1
             2          2
             3          3
             4          4
             5          5
    S#2> -- Now, session #2 will update one row in DEST table
    S#2> update dest
      2     set y = 40
      3   where x = 4;
    1 row updated.
    S#2> select * from dest;
             X          Y
             1          1
             2          2
             3          3
             4         40
             5          5
    S#1> -- Session #1 issues the following MERGE:
    S#1> merge into dest d
      2  using (select * from src) s
      3     on (s.x = d.x)
      4   when matched then update set d.y = s.y
      5   when not matched then insert (d.x, d.y)
      6        values (s.x, s.y);
    -- At this point, session #1 becomes blocked as it can not modify row locked by session #2
    S#3> -- Now, session #3 inserts new row into DEST and commits.
    S#3> -- MERGE in session #1 is still blocked.
    S#3> insert into dest values (6, 6);
    1 row created.
    S#3> select * from dest;
             X          Y
             1          1
             2          2
             3          3
             4          4
             5          5
             6          6
    6 rows selected.
    S#3> commit;
    Commit complete.
    S#2> -- Session #2 rolls back its UPDATE.
    S#2> rollback;
    Rollback complete.
    -- Finally, session #1 is getting unblocked, but...
    merge into dest d
    ERROR at line 1:
    ORA-00001: unique constraint (MAX.SYS_C0032125) violated
    S#1>Hope this helps,
    Andrew.

  • Problem with merge into

    Hi All!
    Following statement give me an error ORA-00904: Invalid column name in the string:
    on (Mirror.ARCH_FLAG=qt.ARCH_FLAG and Mirror.CREDIT_HEADER_ID=qt.CREDIT_HEADER_ID)
    merge into CREDIT_HEADER_P Mirror
    using (select
    CREDIT_HEADER_ID,
    PO_DATE,
    HP_RECEIVED_DATE,
    PDA_ID,
    CUSTOMER_BASE_NR,
    CREDIT_TYPE,
    CREDIT_CURRENCY,
    CLAIM_SUBTYPE_ABREV,
    CUST_PO_NO,
    BILLING_NO,
    OMS_START_SECTION_NO,
    OMS_END_SECTION_NO,
    OMS_SHIP_VIA,
    OMS_CHANGE_REASON_CODE,
    CUST_COMMENT,
    SPECIAL_INSTRUCTIONS,
    CASH_DISCOUNT,
    TARGET_SYSTEM,
    DATE_SENT_TO_TARGET_SYSTEM,
    ARCH_FLAG,
    RECORD_EXTRACTION_DATE,
    LAST_MOD_DATE
    from INC_CREDIT_HEADER_P) qt
    on (Mirror.ARCH_FLAG = qt.ARCH_FLAG and Mirror.CREDIT_HEADER_ID = qt.CREDIT_HEADER_ID)
    when matched then
    update
    set      Mirror.CREDIT_HEADER_ID=qt.CREDIT_HEADER_ID,
         Mirror.PO_DATE=qt.PO_DATE,
         Mirror.HP_RECEIVED_DATE=qt.HP_RECEIVED_DATE,
         Mirror.PDA_ID=qt.PDA_ID,
         Mirror.CUSTOMER_BASE_NR=qt.CUSTOMER_BASE_NR,
         Mirror.CREDIT_TYPE=qt.CREDIT_TYPE,
         Mirror.CREDIT_CURRENCY=qt.CREDIT_CURRENCY,
         Mirror.CLAIM_SUBTYPE_ABREV=qt.CLAIM_SUBTYPE_ABREV,
         Mirror.CUST_PO_NO=qt.CUST_PO_NO,
         Mirror.BILLING_NO=qt.BILLING_NO,
         Mirror.OMS_START_SECTION_NO=qt.OMS_START_SECTION_NO,
         Mirror.OMS_END_SECTION_NO=qt.OMS_END_SECTION_NO,
         Mirror.OMS_SHIP_VIA=qt.OMS_SHIP_VIA,
         Mirror.OMS_CHANGE_REASON_CODE=qt.OMS_CHANGE_REASON_CODE,
         Mirror.CUST_COMMENT=qt.CUST_COMMENT,
         Mirror.SPECIAL_INSTRUCTIONS=qt.SPECIAL_INSTRUCTIONS,
         Mirror.CASH_DISCOUNT=qt.CASH_DISCOUNT,
         Mirror.TARGET_SYSTEM=qt.TARGET_SYSTEM,
         Mirror.DATE_SENT_TO_TARGET_SYSTEM=qt.DATE_SENT_TO_TARGET_SYSTEM,
         Mirror.ARCH_FLAG=qt.ARCH_FLAG,
         Mirror.RECORD_EXTRACTION_DATE=qt.RECORD_EXTRACTION_DATE,
         Mirror.LAST_MOD_DATE=qt.LAST_MOD_DATE,
         Mirror.RECORD_STATUS='M'
    when not matched then
    insert (
    Mirror.CREDIT_HEADER_ID,
    Mirror.PO_DATE,
    Mirror.HP_RECEIVED_DATE,
    Mirror.PDA_ID,
    Mirror.CUSTOMER_BASE_NR,
    Mirror.CREDIT_TYPE,
    Mirror.CREDIT_CURRENCY,
    Mirror.CLAIM_SUBTYPE_ABREV,
    Mirror.CUST_PO_NO,
    Mirror.BILLING_NO,
    Mirror.OMS_START_SECTION_NO,
    Mirror.OMS_END_SECTION_NO,
    Mirror.OMS_SHIP_VIA,
    Mirror.OMS_CHANGE_REASON_CODE,
    Mirror.CUST_COMMENT,
    Mirror.SPECIAL_INSTRUCTIONS,
    Mirror.CASH_DISCOUNT,
    Mirror.TARGET_SYSTEM,
    Mirror.DATE_SENT_TO_TARGET_SYSTEM,
    Mirror.ARCH_FLAG,
    Mirror.RECORD_EXTRACTION_DATE,
    Mirror.LAST_MOD_DATE
    values (
    qt.CREDIT_HEADER_ID,
    qt.PO_DATE,
    qt.HP_RECEIVED_DATE,
    qt.PDA_ID,
    qt.CUSTOMER_BASE_NR,
    qt.CREDIT_TYPE,
    qt.CREDIT_CURRENCY,
    qt.CLAIM_SUBTYPE_ABREV,
    qt.CUST_PO_NO,
    qt.BILLING_NO,
    qt.OMS_START_SECTION_NO,
    qt.OMS_END_SECTION_NO,
    qt.OMS_SHIP_VIA,
    qt.OMS_CHANGE_REASON_CODE,
    qt.CUST_COMMENT,
    qt.SPECIAL_INSTRUCTIONS,
    qt.CASH_DISCOUNT,
    qt.TARGET_SYSTEM,
    qt.DATE_SENT_TO_TARGET_SYSTEM,
    qt.ARCH_FLAG,
    qt.RECORD_EXTRACTION_DATE,
    qt.LAST_MOD_DATE
    But! If I do:
    select Mirror.CREDIT_HEADER_ID
    from CREDIT_HEADER_P Mirror
    or
    select Mirror.ARCH_FLAG
    from CREDIT_HEADER_P Mirror
    I don't get any error. I copied (not entered new!) The column and table name from the statement above! If I submit Mirror.ARCH_FLAG and Mirror.CREDIT_HEADER_ID with 1, it works also. Any ideas?
    Regards,
    Andrej

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_915a.htm#2080942
    You cannot specify DEFAULT when updating a view.
    You cannot update a column that is referenced in the ON condition clause. Problem is you use ARCH_FLAG and CREDIT_HEADER_ID in ON clause -
    on (Mirror.ARCH_FLAG = qt.ARCH_FLAG and Mirror.CREDIT_HEADER_ID = qt.CREDIT_HEADER_ID)
    and try to update them:
    set Mirror.CREDIT_HEADER_ID=qt.CREDIT_HEADER_ID,
    Mirror.ARCH_FLAG=qt.ARCH_FLAG,
    It violates the deterministic.
    Rgds.

  • Problem with merge records

    Hi All,
    My problem statement is as follows -
    I have Customer Master data coming from a single client having some duplicates (internal). I have imported the data and merged the duplicates in the Data Manager client. Now while merging the records I am ending up with only a single record corresponding to say two merged records.
    I have to send this data to BW where report has to be generated based upon the consolidated Master data.
    Now my problem is that when I am syndicating the data I am able to send only a single merged record to BW however in BW the transactios are running on both the records (i.e both duplicate records).
    Is there any way through which I can let both records be passed to BW (even after a merge operation in MDM)?
    P.S. I have to retain the different Customer IDs after de-duplication (consolidation) as transactions have taken place over them.
    Regards,
    Pooja

    Hi
    I had same problem.  Here to solve this you need to have right XSD defined with Root Element for syndication.  Usually while extracting of xml you dont get the source id and key by default.  You have to map the Roots for this then only the Source id and key will be exported.  Also while syndicating the XML is generated for all the sources that you contiain in your repository but only the orginal source pointing to the record will contain the referece to that respective system.  so in XI you need to export only the recrod entry from XML which contains the Source system id and key into BI.
    Hope this answers you.
    Regards
    Veera

  • Problem with Merge..Pls help !!!

    MERGE
    INTO main m
    USING temp t
    ON ( t.id = m.id )
    WHEN NOT MATCHED
    THEN
    UPDATE set m.edate=t.sdate where m.edate is null
    INSERT (m.id
    , m.name
    , m.address
    , m.sdate
    , m.edate)
    VALUES (t.id
    , t.name
    , t.address
    ,t.sdate
    ,t.edate);
    When i execute this query i am getting ORA 00905 error. This is a simple query and is easily understandable. When data in two tables doesn't match i am trying to update based on a condition and insert. Can anyone help and tell me whats wrong and how to proceed further
    Thanks,
    VJ
    Edited by: user13365939 on Aug 12, 2010 8:34 PM

    Frnk, Thanks for your quick response but it doesn't solve my problem.
    Here is my scenario. Can you tell me how this can be done..
    create table temp
    id int,
    name varchar(10),
    address varchar(10),
    sdate date,
    edate date
    create table main
    id int,
    name varchar(10),
    address varchar(10),
    sdate date,
    edate date
    INSERT INTO temp
    (id, name, address, sdate, edate)
    VALUES
    (1,'a','add1',sysdate, null);
    INSERT INTO temp
    (id, name, address, sdate, edate)
    VALUES
    (2,'b','add2',sysdate, null);
    INSERT INTO main
    (id, name, address, sdate, edate)
    VALUES
    (1,'a','add1',sysdate, null);
    INSERT INTO temp
    (id, name, address, sdate, edate)
    VALUES
    (2,'b','address change',sysdate, null);
    Here we have a data change in both the temp and main tables. Value in the second row( Address field). In this case since the data doesnt match i now need to update the m.edate=t.sdate where m.edate is null and then insert a rew record in main table. Can you tell me how this can be done. I need to do this only if the two table datas doesnt match so i need this to be done in WHEN NOT MATCHED section right? or do you know how this can be done? If data doesnt match then i have to update the enddate in main table which is set to null with start date in temp table where all main.enddate is null and then insert a new record. Appreciate if you could tell me how to do this?

  • Problem with merging changes made in Business Catalyst

    I put some text frames in my Muse project and now my client try to make some changes in text using Business Catalyst but we have big problem because it is impossible to merge changes back to the Muse project. The site is in Polish language but I also tried to do it with English. The result is different but also wrong.
    As you can see bellow (screen1)I tried to change words "Adobe Muse" to "adobe muse" and "apps" to "application". Look at Preview on Page result. The newe phrase "adobe muse" is inside the word "videos" instead of following it. So we have: " ....and videoadobe museuse is....". But fortunatelly after clicking "Merge into Muse" everything is OK (screen2).
    But when I use Polish language both results are wrong: Preview on Page and the result after merging (see screen 3 and 4)
    So I can't work together with my client and it's a big problem because I choose Muse and Business Catalyst for this project just to have this possibility.
    Some ides about reasons? I hope these problems are easily solvable.

    Hi TheArtDictator,
    The issue you're running into is similar to http://forums.adobe.com/message/6012076#6012076.
    There isn't a fix yet. What we know is that HTML character entities (like &reg; or &ndash;) can somehow appear in content edited using In-Browser Editing. The Muse sync process doesn't expect/handle them correctly. What we don't know is what causes these entities to be inserted. To help us figure that out, could you find out:
    - Which OS and browser (including versions) were used by the client?
    - Did the client copy/paste content from external sources?
    Thanks,
    Abhishek

  • Creating new Layout problem with merged table within std_resources.htm

    Dear All,
    i am relatively new to oracle ucm and i am trying to add new comonent to create new layout from oracle Create and Modify Layout Sample Component* example under http://www.oracle.com/technetwork/middleware/content-management/index-092832.html .
    i want to ask about the following
    in this component i have CreateLayout_Layouts Table, CreateLayout_PublishedWeblayoutFiles Table and CreateLayout_PublishedStaticFiles Table. These tables should be merged with LmLayouts table, PublishedWeblayoutFiles table and PublishedStaticFiles table respectively in the std_resources.htm file in the <install_dir>/shared/config/resources directory.
    The problem is in my std_resources.htm file i have the following :
    <tr>
         <td>LmLayouts</td><td>LmLayouts</td><td>LmLayouts</td><td>id</td><td>label</td>
         <td></td><td>7.3</td><td>1</td>     
    </tr>
    how can i add (merge) the CreateLayout_Layouts Table in LmLayouts table? what is should fill the <td>s ?
    for PublishedWeblayoutFiles table and PublishedStaticFiles table they are not exist in my std_resources.htm file. are there names changed? or shall i add them(if yes, what is the <td>s had inside).
    note: i will be greatfull if someone have the std_resources.htm that have the above tables merged with the specified ones.

    I believe that sample is old. i have been pushing to get an updated version out also. Hopefully the fragmentary information I will give here will help.
    The main changes are dynamic data tables which replace the includes to control the menu items and relationships. The old things should work still but good to use the new. At the end is an example of merge rules.
    See 3.5.2 Dynamic Data Tables
    http://docs.oracle.com/cd/E21764_01/doc.1111/e10807/c03_components.htm
    ==============================
    CoreMenuItemRelationships table example
    <?commatable mergeKey="primaryKey" derivedColumns="primaryKey:parentId+id"?>
    parentId,           id,                loadOrder
    MY_CONTENT,      NEW_PAGE,                9000
    ================================
    CoreMenuItems table example
    <?commatable mergeKey="primaryKey" derivedColumns="primaryKey:parentId+id"?>
    id,                label,                linkType,           linkData
    NEW_PAGE,                    wwNewPage,                    cgi,                IdcService=GET_DOC_PAGE&Action=GetTemplatePage&Page=NEW_PAGE
    ============================
    CoreMenuItemsFlags table example
    <?commatable indexedColumns="id"?>
    id, flags
    WORK_IN_PROGRESS, isSubAdmin
    =======================
    CoreMenuItemsImages table example
    <?commatable indexedColumns="id"?>
    id, image, imageOpen
    ACTIVE_WORKFLOWS,      ReviewContent.gif,
    Glue file example: (note I am not willing to upload a zip file of a full component sorry)
    <?hda version="11gR1-dev" jcharset="UTF8" encoding="utf-8"?>
    @Properties LocalData
    ComponentName=NewLayout
    blDateFormat=M/d/yyyy {h:mm[:ss] {aa}[zzz]}!mAM,PM!tAmerica/Chicago
    hasPreferenceData=0
    preventAdditionalComponentDowngrade=0
    serverVersion=7.1
    version=2011_11_13-dev
    @end
    @ResultSet ResourceDefinition
    4
    type
    filename
    tables
    loadOrder
    resource
    resources/newlayout_resource.htm
    null
    10
    template
    templates/newlayout_template.hda
    null
    10
    resource
    resources/newlayout_strings.htm
    null
    10
    @end
    @ResultSet Filters
    4
    type
    location
    parameter
    loadOrder
    @end
    @ResultSet MergeRules
    4
    fromTable
    toTable
    column
    loadOrder
    NewLayout_Layouts
    LmLayouts
    id
    10
    NewLayout_PublishedWeblayoutFiles
    PublishedWeblayoutFiles
    path
    10
    NewLayout_PublishedStaticFiles
    PublishedStaticFiles
    null
    10
    NewLayout_LayoutSkinPairs
    LmLayoutSkinPairs
    null
    10
    NewLayout_Templates
    IntradocTemplates
    name
    10
    @end
    @ResultSet ClassAliases
    3
    classname
    location
    loadOrder
    @end

  • Problem with merging partitions

    Hi all,
    I am having a bit of trouble partitioning the HD on the MBP. I hope you guys can help me. I would like to reformat the drive and have made a partition entitled "Backup" (see image link above) to store the files I need. 
    Now, I would like to merge "Macintosh HD" and "Macintosh HD 2" together but it won't do it. I have tried in recovery mode and I have tried deleting Mac HD 2 and pulling down Mac HD. Both methods did not work. Appreciate any help. Thank you and sorry if this problem has been posted in the forum.

    Something is messed up in the partition map which means you will have to repartition the entire drive from scratch.
    Drive Partition and Format
    1. Boot from a bootable external drive. Open Disk Utility.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Note the SMART status of the drive in DU's status area.  If it does not say "Verified" then the drive is failing or has failed and will need replacing.  SMART info will not be reported  on external drives. Otherwise, click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Apply button and wait until the process has completed.

  • Problems with Merge Data Files

    Created a form with radio buttons and finally have it working on my computer including the Merge Data Files creating the report.csv file.  However, when my co-worker creates the report.csv, the columns for the radio buttons are not included.  Had this problem on my computer when I had names for the radio buttons, but fixed it.  The data columns for the radio buttons are not exported on the co-workers computer.  Both are Pro X version, mine 10.0.0 but co-worker's is 10.1.7.
    Any suggestions?

    Back up all data.
    Please triple-click anywhere in the line below on this page to select it:
    defaults delete -app Safari WebKitOmitPDFSupport
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Quit Safari. Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    Wait for a new line ending in a dollar sign (“$”) to appear below what you entered. You can then quit Terminal. Test.

Maybe you are looking for