How poor is this practice?

We have applications at work that spend most of the day rolling back insert statements because of attempts to insert dupe data into a unique indexed table.
How poor is this practice to eliminate duplicates?
It seems to be a common practice by those use to working with SQL Server.
Why is it any different in SQL Server than Oracle?

>
It is evident the developer has chosen the lazy way to deal with the dupes by introducing a unique index that uses a natural key but for whatever reason he sees this natural key repeat over and over thru out the day.
His code uses insert all into so that he can insert in batches and probably doesn't even realize he loses his entire batch whenever there is a dupe on insert.
>
Well you need to modify the process as suggested by me and others.
IMHO the simplest way is to use the MERGE statement and the NOT MATCHED condition. That allows you to insert the new rows while ignoring the matched rows.
See MERGE in the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm
>
MERGE Purpose
Use the MERGE statement to select rows from one or more sources for update
>
Here is an Oracle-base example
http://www.oracle-base.com/articles/10g/merge-enhancements-10g.php
Optional Clauses
The MATCHED and NOT MATCHED clauses are now optional making all of the following examples valid.
-- Both clauses present.
MERGE INTO test1 a
  USING all_objects b
    ON (a.object_id = b.object_id)
  WHEN MATCHED THEN
    UPDATE SET a.status = b.status
  WHEN NOT MATCHED THEN
    INSERT (object_id, status)
    VALUES (b.object_id, b.status);
-- No matched clause, insert only.
MERGE INTO test1 a
  USING all_objects b
    ON (a.object_id = b.object_id)
  WHEN NOT MATCHED THEN
    INSERT (object_id, status)
    VALUES (b.object_id, b.status);
-- No not-matched clause, update only.
MERGE INTO test1 a
  USING all_objects b
    ON (a.object_id = b.object_id)
  WHEN MATCHED THEN
    UPDATE SET a.status = b.status;The second example above will 'ignore' the duplicates.
My second choice would be to use DML error logging.

Similar Messages

  • I can't forcequit firefox and shutdown my computer, nor can I open up any other programs or applications. Does anyone know how to fix this? please help this poor soul.

    I can't forcequit firefox and shutdown my computer, nor can I open up any other programs or applications. Does anyone know how to fix this? please help this poor soul.

    You can force quit applications
    >Force quit
    if that does not work you can force quit a computer shut down by hold the power button for an extended period.

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • How to fix this error? The startup disk cannot be partitioned or restored to a single partition.

    Hey guys,
         I am trying to install windows 7 ultimate 64 bit via bootcamp assistant. I open bootcamp assistant from utilities and i get the second window and try to click continue and i get a pop up, saying "The startup disk must be formatted as a single Mac OS Extneded (journaled) volume or already partitioned by Boot Camp Assistant for installing Windows." I looked around on the internet, i found that my internal HD must be set to OS Extended (Journaled). I went into disk utility and i clicked partition tab and the option was set to OS extended (journaled). Any ideas on how to overcome this error so i can install windows 7?

    Error is:
    1: common
    2: misleading and poorly worded
    3: space must be:
    A: contiguous, that means unfragmented and in ONE section, not multiple
    B: files cannot be loced, anchored or in such a manner as to prevent or block partition operation
    C: to move, unlock and shuffle files requires booting from another drive or device
    Shrink the HFS+ volume by as much or more than you need to set aside to use
    If that does not,
    Try iDefrag from another hard drive or by burning and using its own CD that is just for consolidating free space
    Clone your system (should have backups already, clone is just bootable)
    Erase and restore from clone - SuperDuper does consolidate files and free space and result in unfragmented (99% success rate)
    None of which has to do iwth what that error message says. This error has been almost a daily threat topic - has gotten less but has not "gone away."

  • TS4002 Hello, icloud receive messages from gilly hicks, but does not receive messages from another personal account... this is happening me since one week and i dont know how to solve this.... error in the mail delivery system says not valid IPv4 SMTP err

    Hello, icloud receive messages from gilly hicks, but does not receive messages from another personal account... this is happening me since one week and i dont know how to solve this.... error in the mail delivery system says not valid IPv4
    SMTP error from remote mail server after RCPT TO:<[email protected]>:
       host mx6.me.com.akadns.net [17.158.8.114]: 550 5.7.0 Blocked - see https://support.proofpoint.com/dnsbl-lookup.cgi?ip=184.173.9.56:
       [email protected]
    i do alse receive from gmail....
    please help... what is happening!!!!

    Just to recap, this is a collection of ports I have collected over time for people who needed this information when setting up the HP ePrint app so that they could view their email from within the app.  I am certain other applications also need this information.  Although lengthy, I could not find a more comprehensive place to retrieve this information.  Feel free to post additional information, faulty information, or other related topics below as this is simply a collection of data and it would be practically impossible to test all of them. Thank you!
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • So how bad is this?

    So today, for the first time in as long as I've owned my 2.0 GHz iMac G5, it just randomly shut down on me. I thought it was a one time thing, a power surge or something maybe, so I started it back up and went about my business. Then a few hours later, it happened again. And about 20 mins after that, again. By this point I knew something was up, so I backed up a couple vital files real quick, shut it down, and cracked it open.
    This is what I saw:
    http://img.photobucket.com/albums/v12/newtikki/DSC00185.jpg
    So, I figured it was overheating because of the symptoms, but that looks really bad. When I closed it back up, I felt the slit in the back and couldnt feel any air coming out the half that the CPU feeds to, however, the other half (which i presume is pumped from the video card) was pumping warm air. So, how can I resolve this? I bought it in probably June of last year, so I don't have any warranty remaining. How much is this going to cost me?
    Thanks,
    Michael
    iMac G5   Mac OS X (10.4.6)  

    Hi Michael,
    My bet is actually that your primary problem is that the power supply is failing, and that your fans just might be running poorly because of dirt buildup or lower power.
    Your Mac will cut out before heat doess any damage to the processor.
    There are three fans - one for the Hd, one for the processor , and one for the "system" generally. The HD fan is really the one that does the most work usually. Its "base" setting is at 2300 RPM, while the CPU one sits down around only 1500 when its not doing a lot of work. Its only under load that it kciks up higher, and even then it will rarely be running as fast as the HD fan.
    So you can almost always expect to feel a bit more breeze from the HD side than the processor side of the slot.
    The general system fan usually sits on about 1700 rpm until things really start to heat up.
    Cheers
    Rod

  • Why Memory Manager .cpp Error.How to avoid this

    I am getting getting the attached error when developing labview program.
    Why this error is coming?
    How to avoid this?
    Attached the error screen shot
    Attachments:
    MemoryCppError.png ‏33 KB

    Hi Selvan,
    we don't know your VI, thus we don't know the cause…
    Practical advice: save often, save early!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Suddenly nearly all apps on my iPad2 crash, homescreen is back. how to fix this?

    Hi,
    once my apple-id was locked and i needed to change my password, nearly all the apps on my iPad 2 crashes after they've launched. For example i want to check email, read a new email and suddenly i'm back in homescreen. When i start up Mail.app again, the last state was back after i checked email again. So all emails of the last time needed to be loaded again.
    I used facetime and suddenly i'm also back in the homescreen and the facetime-connection is closed. I've rebootet my iPad more times, changed the apple-id and password again also in my iPad. I also deleted the iCloud-configuration on my iPad and also the iCloud-EMail.
    My Apple-ID with new name and password is working fine on my MacBook and i could also connect to icloud.com. Only my ipad is not working well. Also the settings.app was closed suddenly after i want to re-enter my icloud configuration. so i have deleted the icloud-config an don't use iCloud at moment.
    My iPad is the 64 GB model, without jailbreak. I just checked the SSD-Size in settings.app and when i typed the words on this line, the settings.app is crashed and back to home-screen.
    When i double-tap the home-button, i still could see the crashed apps there.
    How to solve this problem? Anybody an idea?
    Sorry for my poor english, i have learned english a long long time ago in school.
    Greetings,
    Jan

    Hi there,
    i got some news. I have made factory-reset and restored the backup made with iTunes. After that, my iPad worked well again, like normal. The problem is, after a few days, i could get back the same problems like before. The battery is discharging faster, because i think the iPad is working in the background a lot. Poor that apple didn't include a taskmanager where i can see the cpu-load. But when i launch the application "kill", i could see that the memory-usage is normal after reset and restore, a few days later it's higher again. Actually this error is back, so i can't really use any app normal. After any time, the app crashes. I also want to use the AppStore, but today i needed around 10 times to get it working. I launch the AppStore, then after a few seconds i'm back in homescreen. Maybe after the 10th launch i didn't get back to homescreen and i could read a bit in the AppStore.
    Any other ideas about that? I've made restart of the iPad more times, but i can't get it back working again.
    Jan

  • How to achieve this type of Writing

    I finally my Intuos tablet and I been trying to make this type of lettering, but I haven't had no luck. I been messing with the settings of the "Calligraphic" brushes and nothing. If someone out there knows how to achieve this and is willing to share the knowledge I'd be very helpful and I'd appreciate it it very much!
    http://img209.imageshack.us/img209/1186/typevl0.jpg
    Thanks!

    I'm afraid your expectations may be a bit unrealistic. That's not going to automatically happen by merely stroking away with a stylus using a Calligraphic Brush.
    Whether you're using a stylus or a mouse for your input device, that kind of text design is drawn deliberately and carefully with the Pen tool, creating paths along the edges of the glyphs.
    You
    might achieve a rough sketch as a starting point, but even then it would be better (and most probably easier) done by drawing centerline paths with the Pen and applying the Calligraphic Brush to those paths. Better still, start with a pencil sketch, scan it, and just start tracing that with the Pen. Tracing text is excellent practice for learning to use the Pen.
    JET

  • Ive lost my apple ID for my ipod, now i have an iphone and i want to use the same apple ID for both can someone tell me how to do this

    I have lost my apple ID for my ipod, now ive got a new iphone and i want to use the same ID for both, can anyone one tell me how to do this? ( i no my ID for the iphone)

    Just use the same ID.
    These may alos help:
    How to use multiple iPods, iPads, or iPhones with one computer
    What is the best way to manage multiple...: Apple Support Communities

  • I locked myself out of my ipod touch for 60 mins then actually typed the wrong password in again.  Now it is telling me to "connect to itunes".  I am unsure how to do this.  I am unable to use my ipod at all now. Please help.

    Hi,
    Due to my brother locking me out of my ipod touch I had to wait an hour to log in again.  Unfortunately when I did this, I, again put in the wrong password twice more, each time locking me out for a further 60 minutes.  On my 3rd attempt to log in the wrong password was entered again.  This time though instead of logging me out for another 60mins it now tells me to "connect to itunes" but I have no idea how to do this and I am now unable to use my ipod.  Please help.

    See Here  >  http://support.apple.com/kb/HT1212

  • I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem?

    Problem with an incoming message. For example, during my conversation the second line receives a call, I hear the sound in dynamics such as "piiiip piiiip," but when in this situation I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem? Perhaps someone tell me? save in advance

    Not Charge
    - See:     
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • Recently loaded Lion on my laptop and now my computer crashes often. Black screen and keyboard lights up. Any ideas on what's wrong and how to fix this?

    Recently loaded Lion on my laptop and now my computer crashes often. Black screen and keyboard lights up. Any ideas on what's wrong and how to fix this?

    Everytime this happens Ihave to power down and restart! Any ideas would be appreciated!

  • I bought an I pad 2 from us but I can not activate the Facetime in UAE(Dubai)as I can not see the country in the I pad's  drop list, anyone has an idea as how to resolve this issue

    I bought an I pad 2 from us but I can not activate the Facetime in UAE(Dubai)as I can not see the country in the I pad's  drop list, anyone has an idea as to how to resolve this issue

    I'm not that familiar with how FaceTime works. I know how to set It up but I don't use it. I just know that you can't activate in the UAE. I believe that you can activate in any country that permits it's use. Whether you will need a new ID or not, I can't confirm.
    You can Google this and get all sorts of articles on workarounds. Apparently if you set up a VPN you can use it in the UAE. Here is one article that I found.
    http://talkfree7.blogspot.com/2010/09/how-to-facetime-voip-call-from-uae.html
    I Googled "workaround for FaceTime in UAE" to find this.

  • After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer. Does anyone have any advice on how to fix this issue?

    After moving to iCloud I can only get my email through the cloud, no new emails are making it to my home computer and .mac account. Does anyone have any advice on how to fix this issue?

    Welcome to the Apple Community.
    Which OS are you using.

Maybe you are looking for

  • Itunes won't play one of the song i have purchased in an album and all the rest of the song play

    I recently purchased David Guetta Nothing But the Beat ultimate and have found all the song but one play. The song I am having problems playing is Metropolis it appears to be asking for authorize it, which puzzles me as i have purchased the music fro

  • Create goods receipt using bapi fm

    hi friends,               i am geetha, i having a problem like while creating the goods receipt .    create a goods receipt without purchase order using the tcode MB1C , I NEED EXACT  BAPI function module  to create agoods receipt. my fields are :   

  • How do I update my CS5 so that I can process my Fuji X-E1 raw files

    How do I update my CS5 so that I can process my Fuji X-E1 raw files

  • Setting focus in TextArea using AWT

    I have looked at all the documentation for the TextArea in the API and cannot work out how to set the focus in a TextArea when a frame is loaded. Should it go in the constructor? the main method? the TextArea? I have tried to use hasFocus() but nothi

  • Problems with Java on OS X 10.10

    Summary: I have installed Eclipse, but can't get it to run. It tells me to use legacy Java, then (when given legacy Java), it tells me my Java is too old. I kept getting an error when I tried to post ("You can only use links to eclipse.org sites whil