Need Help Can i use Merge command along with exist function in oracle?

I am using Merge command to update the destination table and updating the rows which are already in the destination table.
But what i want is to delete the existing rows from the destination table and insert fresh rows instead of updating the existing rows in the destination table.
So can we use exist function to check the existing rows and delete them and use merge command to insert the rows in the table.

You definitely need to do a DELETE then INSERT since MERGE will not delete rows, although I'm not really sure what that gets you since the net effect would be the same as a MERGE over the same pair of tables.
If you really want to do it this way, then I would likely do something like:
DELETE FROM target_table
WHERE (columns_you_would_match_on) IN (SELECT columns_you_would_match_on
                                       FROM source_table
                                       WHERE predicate_you_would_use_in_using);
INSERT INTO target_table (column_list)
SELECT column_list
FROM source_table
WHERE predicate_you_would_use_in_using;John

Similar Messages

  • As. Fashion designer can I use illustrator cc along with photoshop cc

    As  a fashion designer can I use illustrator cc along with photoshop cc
    @is illustrator cc compatible with photoshop cc?

    Thank you so much for answering my question. It was a great help.
    SIncerely,
    Gail Sarasohn

  • When I set up my exchange account on iPad2 cameras always become disabled. What's the problem, can I use my cams along with using exchange mail?

    Can someone help me with this question? Why iPad 2 disables camera when I set up my Exchange mail account? How can I enable camera along with using mail?

    The iPad is not disabling the camera - the administrator for your Exchange account is. You need to go to the person who administers your Exchange account and ask them to lift the restriction on cameras in their Exchange system.

  • Need help can not use my Photoshop Elements

    Hi
    I bought the Samung Series7 Ultra "CORE i5" from Bestbuy.
    but every time I try to open photoshop so I can not. Why ? Error 213:19

    http://helpx.adobe.com/photoshop-elements/kb/licensing-problem.html

  • Nokia 5000d help (can i use this is spain with a u...

    Hiya Guys
    Can someone please tell me if i can use a Nokia 5000d Mobile in spain with a UK T-MOBILE SIM?
    Many Thanks

    Thanks for your reply, Im not sure if its sim unlocked but it currently works with a T-mobile uk sim card here in the uk, What id like to know is will the phone work in spain because im not sure if its tri band or a dual band phone & i cant seem to find out. If you know this you'd be a great help. Thanks

  • Can we have ORDER by along with SQLX functions?

    Hi All,
    I have used the following SQL query to generate a XML file.
    select XMLElement("rowset", XMLForest('yyyymmdd hh:mm',"file_date", 'yyyymmdd' "business_date"),XMLElement("privilege", XMLForest(user_name "User_Name",user_role "User_Role"))).extract('/*')
    from (
    select * from
    ((select user_name, user_role from a
    union
    select user_name, user_role from b) tab_a,
    (SELECT TO_CHAR (current_timestamp, 'YYYYMMDD HH:MI') file_date,
    (SELECT TO_CHAR (business_date, 'YYYYMMDD')
    FROM c) business_date
    FROM DUAL) tab_b)
    group by business_date, file_date;
    Can someone suggest how to modify this query in order to sort the rows on user_name and then user_role?
    Thanks in advance.
    Annie

    Why not just use an ORDER BY clause? Also, it's always very helpful to post any SQL code in \ tags so it's readable.SELECT XMLElement("rowset", XMLForest('yyyymmdd hh:mm',"file_date", 'yyyymmdd' "business_date"),XMLElement("privilege", XMLForest(user_name "User_Name",user_role "User_Role"))).extract('/*')
    FROM
    SELECT *
    FROM
    SELECT USER_NAME, USER_ROLE FROM A
    UNION
    SELECT USER_NAME, USER_ROLE FROM B
    ) TAB_A
    SELECT TO_CHAR (CURRENT_TIMESTAMP, 'YYYYMMDD HH:MI') FILE_DATE
    SELECT TO_CHAR (BUSINESS_DATE, 'YYYYMMDD')
    FROM C
    ) BUSINESS_DATE
    FROM DUAL
    ) TAB_B
    GROUP BY BUSINESS_DATE, FILE_DATE
    ORDER BY USER_NAME /* ORDER BY CLAUSE HERE */
    , USER_ROLE;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Hello.  I need help.  I use Photoshop Elements 10 on my MAC but it no longer reads discs.  Can I download it from the internet with my original package serial number?

    Hello.  I need help.  I use Photoshop Elements 10 on my MAC but it no longer reads discs.  Can I download it from the internet with my original package serial number?  thanks

    Yes, from here:
    Download Photoshop Elements products | 13, 12, 11, 10

  • Hii i need help i cannot use my apple id for download on app store because they say i need to verify my account but i don't know how so please somebody can help me? i try to resset my password but that don't help

    hii i need help i cannot use my apple id for download on app store because they say i need to verify my account but i don't know how so please somebody can help me? i try to resset my password but that don't help

    is it asking for ur security questions?

  • This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangly (I need help trying to use it)

    My Vista Home Premium desktop has not used Firefox for a long time. I just loaded it as well as on my Honeycomb Android. The statement that I made pretty much says what my problem is. I can use both of them at the same time and use a router with the air Verizon card installed.
    I'll repeat my question: This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangely (I need help trying to use it)

    My Vista Home Premium desktop has not used Firefox for a long time. I just loaded it as well as on my Honeycomb Android. The statement that I made pretty much says what my problem is. I can use both of them at the same time and use a router with the air Verizon card installed.
    I'll repeat my question: This is detailed: I lost my touch pad scroll ability on my desktop when I installed Firefox, I am having a terrible time trying to sync my new Android tablet to my desktop, my desktop Firefox is acting very strangely (I need help trying to use it)

  • I bought apps from apps store,my money was taken and den I downloaded the pass buh 2 didn't work .it told me iTunes failed to install app,the apps were the dark knight rises(batman) and asphalt 7 I need help plss am using iPad 2

    bought apps from apps store,my money was taken and den I downloaded the apps buh 2 didn't work .it told me iTunes failed to install app,the apps are the dark knight rises(batman) and asphalt 7 I need help plss am using iPad 2

    Although iTune terms says that all sales are final. You can try explaining to get a refund.
    http://www.apple.com/support/itunes/contact/

  • I jailbroke my ipod and its in recovery mode i cant take it out of it and i cant restore becasue i changes host to sariks sever i need help can any one help me

    i cant take it out of it and i cant restore becasue i changes host to sariks sever i need help can any one help me please please i just got my ipod i realy need help

    Sorry, due to the Terms of Use, problems with jailbroken devices can't be discussed here.

  • I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    do I need to create another account with a different email account
    Yes, the email addresses need to be unique to each device. You may use the same Apple ID on each device, but the email address used by each device needs to be different.

  • Need help to import and syncronize HCM pagelets with Interaction Hub, how can I do that?

    Hi,
    I need help to import and synchronize HCM pagelets with Interaction Hub, how can I do that? The default page "Select Remote Content" of the WorkCenter "Unified Navigation WorkCenter" is not working as well, when I run the import/sync button I get the following error message:
    Integration Gateway: General Connection Failed (158,10836)
    This error is thrown when there is no valid response.
    Possible errors include:
    Bad gateway URL
    Sync Service Timeout set and Service actually timed out.
    Java exception thrown - Check Application Server for possible Java exception

    Do you have integration configured between the two systems?  It sounds like you don't from the error.  Here is a walk-through on setting up Unified Navigation although it assumes you have integration already working.  If you haven't done that, it's documented a hundred different places.
    http://remotepsadmins.com/2013/03/04/peoplesoft-unified-navigation-with-peoplesoft-applicatations-portal-interaction-hub/

  • I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    I was trying to get the iOS 8.2 on my iPhone 5 but then it stopped and my phone is now on recovery mode I have pictures I need and they did not all fit on iCloud  how can I use the phone again with ALL my pictures and videos without restoring it?

    Contacts are designed to be synced to a supported application on the computer or a cloud service.
    Pictures taken with the device are designed to regularly be copied off the device to a computer as would be done with any digital camera.
    If you have failed to use the device as designed it may be too late to recovery anything.
    Is the device regularly backed up to a computer via iTunes?  If so, the most recent backup (when restored to a replacement iOS device) should contain all contacts and pictures as of when the backup was created.

  • Can I use my I-phone with 220 volt with only a plug in prong adapter or do I need a voltage converter?

    can I use my I-phone with 220 volt (China) with only a prong adapter, or do I need a votlage converter as well. Unit purchased and used in USA.

    The iPhone charger is a world charger, no voltage converter needed. All you might need is a plug adapter, but that's it. Your charger will work fine & no worries about frying your phone as suggested by the orther poster who has no idea what he/she is talking about.

Maybe you are looking for