ELEMENTS 8 : Problem with Merge

I have a scene I snapped twice.
One exposure is right for foreground but bleaches out the sky.
The other is too dark for the foreground but leaves the sky nicely blue with clouds.
How do I merge the light foreground with the darker sky ? 
All my attempts so far end with the same bleached sky.
24Casa

Many thanks Barbara B.
You've finally forced me to discover what the "best" feature of Photoshop is all about .... I've been avoiding Layers successfully (though guiltily) for years, now, after playing a tutorial or two, its a whole new world !
24Casa

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

  • Premiere Elements 13 , Problems with new text/titles

    Premiere Elements 13, bisher keine Probleme. Nachdem die Filmlänge etwa 15 Minuten beträgt immer größere Probleme Titel/texte einzugeben. Wartezeiten sind extrem lange oder Programm stürzt ganz ab.

    High ATR,
    Computer running on Widows 7 ,64 Bit System, Service Pack 1, Processor AMD Phenom(tm) X4 945 3.00 Ghz;RAM 8 GB
    Grafikkarte: NVIDIA GeForce 8800 GT
    If the video on the timeline is longer than 10 minutes the problem will be remarkable. The response times adding a title is getting longer(2-15 seconds).
    As the video is now 18 minutes the response time is after each action(resizing of letters or any changes of the text) up to 30 seconds or the program crashes completely.
    Project settings are the following:
    General HD 1080i; 29,97frames/second; Video:1920v 1080 H, 30 fps
    Video: maximale Bittiefe, Dateiformat i-frame only mpeg, Kompressor MPRG i-Frame, Standbilder optimieren
    The video is a mixture  of full HD videos 1920x 1080 .mov and pictures up to 4608x3456 pixels.
    When the program crashes I remarked that the main memory RAM(8Gb) was fully used by the premiere program. Might there be a problem?
    Thank you for your service.
    thomasd
    Von: A.T. Romano 
    Gesendet: Sonntag, 1. Februar 2015 23:55
    An: Thomas Deschler
    Betreff:  Premiere Elements 13 , Problems with new text/titles
    Premiere Elements 13 , Problems with new text/titles
    created by A.T. Romano <https://forums.adobe.com/people/A.T.+Romano>  in Premiere Elements - View the full discussion <https://forums.adobe.com/message/7151822#7151822>

  • Premiere Elements cause problems with Windows Media Center while streaming to TV.

    I was having the following problem:
    The audio from the streaming process of a recorded TV show on my HP computer to the remote receivers, a Sony Blu-ray player and/or a Sony Streaming Player, results in the loss of audio signal at exactly 30 seconds from the beginning on either devices. The video continues on as normal.
    A user on the Windows 7 forum had the following possible cause and solution.  His response was as follows:
    I "solved" my issue, at least partially. Turns out for me a codec installed by Adobe Premiere Elements for audio (Main Concept) was causing mfpmp.exe to fail (you should see it getting an appcrash in the event log two or three times as soon as you start playing the media remotely.) This program is used by microsoft for DRM. I went through and one by one remained the various attached (non-microsoft) modules until i found the one that caused the appcrash. I haven't fully figured out if Elements is now negatively effected, but that's for a different forum.
    I tried the quick fix by un-installing Adobe Premiere Elements.  The uninstall solved my problem with Windows Media Center, but I want to re-install the software but I do not want to recreate the problem with Windows Media Center.
    Is there another solution for this problem?

    I reinstalled Adobe Premiere Elements 10 and the above mention problem reoccured.  With a little detective work I was able to determine that the file causing my problem was "mc_dec_dd_ds.ax".  I am not sure what this does to Adobe Premiere Elements 10 since I removed (renamed) the offending file.  A strange side affect, renaming the file did cause an increase volume. Strange.  

  • 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?

  • Elements 12 problem with serial.

    i just bought elements 12 from amazon, intalls fine on a windows 8 machine, But then tells us our trial has expired. Catalog section works but editor tells us we need new application manager. I downloaded and installed it but still doesnt work. Cant find a phone number, The worst christmas presentEVER., Help!!!!

    Hi,
    Since you already have one copy activated the serial number must be logged in your account details - I would first check that the one logged and the one you are attempting to enter are the same.
    You can check your account details by going to www.adobe.com and clicking on Manage Account. You need to sign in with your Adobe Id and then click on View All under Plans & Products. Next click on View your products and after a while it should produce your list.
    If there is a problem with the serial number, only Adobe can help you there (we are just users). Please see the response in this thread
    First of all, I would have to say that getting in touch with you is a nightmare and I am not at all happy that I can't just email or live chat with someone who can help!  I am not a technical person, I just want to be able to use Photoshop Elements and ge
    Brian

  • 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.

  • Elements 12 problem with brush cursor

    I have recently bought Elements 12 (I have used Elements 2 for many years) which I am running on a Dell laptop with Windows 7.  Every time I change the brush cursor size, the cursor becomes corrupted.  It changes to strange shapes and does not work properly.  I have found that I can rectify the probem each time by pressing the spacebar.  The cursor then becomes circular again and works properly, but only until I change the brush size again.  So I have to keep pressing the spacebar all the time when I am trying to use the brushes.  Has anyone else had this problem and know of a fix please?  I have not encountered any other problems with Elements 12.

    Sorry I didn't spot that box and many thanks for the diagram.  I have now reset the brush tool which does revert the cursor to the circular shape and sets it to a small size (13 px), but the problem reoccurs.  As I increase the brush size, when it gets to 250 px, the cursor goes to an odd shape, then it reverts to circular at about 800 px.  A similar thing happens if I then reduce the brush size.
    I am new to this forum, as I didn't have any problems with Elements 2.  After I posted my question, it listed similar questions from other members.  One member descibed an identical problem with an earlier version of Elements.  That post was a very long dialogue and I have just quickly read through it.  He could not fix it and people's suggestions were that it was probably a deficiency with his graphics card.  Unfortunately, I suspect I have the same problem with my Dell laptop. I imagine there is nothing I can do other than buying a new PC, but if you guys have any further suggestions, then that would be great.  Many thanks!

  • 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 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 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.

Maybe you are looking for