Any idea why this MERGE INTO statment fails?

I am using Oracle XE and trying to use a MERGE statment from an external table to a heap table.
MERGE INTO
    ORDER_ITEM_INTELLI_LABS O
USING
    ORDER_ITEM_INTELLI_LABS_STAGE S
    ON (O.ACC_NO = S."Acc No",
         O.DRAW_DATE = to_date(S."Draw Date",'MM/DD/RRRR'),       
        O.MED_REC_NO = S."Med Rec#",
        O.CODE_CPT = S."CPT",
        O.PROVIDER_ID = S."Provider ID",
        O.CLIENT_ID = S."Client ID")
  WHEN NOT MATCHED THEN
    INSERT
        (ORDER_ITEM_INTELLI_LABS_UID,
        DEPARTMENT_UID,
        DRAW_DATE,
        ACC_NO,
        MED_REC_NO,
        PATIENT_NAME,
        LAB_TEST_NAME,
        CODE_CPT,
        INS_CARRIER,
        PROVIDER_ID,
        CLIENT_ID,
        UPLOAD_DATE)
    VALUES
        (null,
        in_DEPARTMENT_UID,
        to_date(S."Draw Date",'MM/DD/RRRR'),
        S."Acc No",
        S."Med Rec#",
        S."Patient Name",
        S."Lab Test Name",
        S."CPT",
        S."Ins Carrier",
        S."Provider ID",
        S."Client ID",
        sysdate)
    where
        S."Draw Date" is NOT NULL;This is what I get:
  1  MERGE INTO
  2      ORDER_ITEM_INTELLI_LABS O
  3  USING
  4      ORDER_ITEM_INTELLI_LABS_STAGE S
  5      ON (O.ACC_NO = S."Acc No",
  6          O.DRAW_DATE = to_date(S."Draw Date",'MM/DD/RRRR'),
  7          O.MED_REC_NO = S."Med Rec#",
  8          O.CODE_CPT = S."CPT",
  9          O.PROVIDER_ID = S."Provider ID",
10          O.CLIENT_ID = S."Client ID")
11    WHEN NOT MATCHED THEN
12      INSERT
13          (ORDER_ITEM_INTELLI_LABS_UID,
14          DEPARTMENT_UID,
15          DRAW_DATE,
16          ACC_NO,
17          MED_REC_NO,
18          PATIENT_NAME,
19          LAB_TEST_NAME,
20          CODE_CPT,
21          INS_CARRIER,
22          PROVIDER_ID,
23          CLIENT_ID,
24          UPLOAD_DATE)
25      VALUES
26          (null,
27          in_DEPARTMENT_UID,
28          to_date(S."Draw Date",'MM/DD/RRRR'),
29          S."Acc No",
30          S."Med Rec#",
31          S."Patient Name",
32          S."Lab Test Name",
33          S."CPT",
34          S."Ins Carrier",
35          S."Provider ID",
36          S."Client ID",
37          sysdate)
38      where
39*         S."Draw Date" is NOT NULL
SQL> /
    ON (O.ACC_NO = S."Acc No",
ERROR at line 5:
ORA-00907: missing right parenthesis
SQL>

This?
MERGE INTO ORDER_ITEM_INTELLI_LABS O
  USING ORDER_ITEM_INTELLI_LABS_STAGE S
  ON (O.ACC_NO = S."Acc No"
      AND O.DRAW_DATE = TO_DATE (S."Draw Date", 'MM/DD/RRRR')
      AND O.MED_REC_NO = S."Med Rec#"
      AND O.CODE_CPT = S."CPT"
      AND O.PROVIDER_ID = S."Provider ID"
      AND O.CLIENT_ID = S."Client ID")
  WHEN NOT MATCHED THEN
    INSERT (ORDER_ITEM_INTELLI_LABS_UID, DEPARTMENT_UID, DRAW_DATE, ACC_NO, MED_REC_NO, PATIENT_NAME, LAB_TEST_NAME,
            CODE_CPT, INS_CARRIER, PROVIDER_ID, CLIENT_ID, UPLOAD_DATE)
    VALUES (NULL, in_DEPARTMENT_UID, TO_DATE (S."Draw Date", 'MM/DD/RRRR'), S."Acc No", S."Med Rec#", S."Patient Name",
            S."Lab Test Name", S."CPT", S."Ins Carrier", S."Provider ID", S."Client ID", SYSDATE)
      WHERE S."Draw Date" IS NOT NULL;

Similar Messages

  • Some photos from one day are showing up on my photo stream, and others from that same day are not. Any idea why this might be?

    Took a bunch of photos on vacation one day, and it seems like the first batch from one day are not showing up, but then all of a sudden, the ones from the second half of the day are there. They are not showing up on the photostream on my iPhone on which I took the photos, or on my iPad or in iPhoto on my computer. Any idea why this could be happening? All the other photos I took all week showed up on my Photostream.
    Is there anyway to force these photos into the photostream?
    Thanks! Any help would be appreciated!

    photo stream uploads photos from your photo app when it is connected to wifi and the photo app has been closed correctly.  That may be why your seeing photos pop up on different dates
    http://support.apple.com/kb/HT4486

  • I am trying to softproof an image using a CMYK .icc file. I sent an image from LR 5 to PS CC 2014, opened the Camera Raw FIlter, but the hyperlink to access workflow is not showing up in the CR dialogue box... Any ideas why this might be?

    I am trying to softproof an image using a CMYK .icc file. I sent an image from LR 5 to PS CC 2014, opened the Camera Raw FIlter, but the hyperlink to access workflow is not showing up in the CR dialogue box... Any ideas why this might be?

    I am trying to softproof an image using a CMYK .icc file. I sent an image from LR 5 to PS CC 2014, opened the Camera Raw FIlter, but the hyperlink to access workflow is not showing up in the CR dialogue box... Any ideas why this might be?

  • When I compose an email in either gmail or yahoo, the cursor lags behind for about 2 seconds. This does not happen when I compose an email with Safari or Chrome. I am using a Mac with Firefox version 3.6.3. Any idea why this happens?

    When I compose an email in either gmail or yahoo, the cursor lags behind for about 2 seconds. This does not happen when I compose an email with Safari or Chrome. I am using a Mac with Firefox version 3.6.3. Any idea why this happens?
    == This happened ==
    Every time Firefox opened

    try
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    I was having this problem while still using Mavericks -- it started after a Mavericks update last spring.  During the initial Yosemite beta runs over the summer, it seemed to be fixed, but after the official launch in October, I had all sorts of problems keeping connected.  Its gotten a little better, but still happens to at least one of my devices every day.  Weird that we still cannot figure out why the connection keeps dropping on some devices, but not others, and then the next day, one of the devices that didn't disconnect the previous day will disconnect, but the ones that did disconnect, stay connected.  It's just sloppy, poorly written software for technology that isn't working the way it should.  If you turn off Continuity and Handoff on all your devices, you will probably see that everything stays connected.  With those turned off on all devices, TC stayed connected to everything for over a month.  The day I turned Continuity back on, all the problems started again.  It had something to do with the bluetooth version being used, the wifi routine, and Apple's AirPlay technology not quite getting along with each other.

  • Iphoto will not re-install after disappearing during a software update, any ideas why this happened?

    Before i ran the software update i had to iphoto icons in the launch pad, both had exactlly the same content so i just ignored it for a wile till i needed to update my photos, which i was hoping to do after the update.
    However when i restarted both iphoto icons had gone and iphoto seems to have been wiped off my mac completelly, I have got a back up of all my pic and videos so this is not a problem of recovering them.
    i have then tryed to instal iphoto from the app store, resulting in there being a perminant downloading icon making no progress over the last two hours.
    If any body has any idea why this happened and what i can do to provent it happening again as well as getting iphoto back the help wil be much apricated.

    In addition to Larry's questions what software update did you apply? Do you still have an iPhoto Library in your Pictures folder? If you do what happens if you double click on it?
    OT

  • My Mac won't read cyrillic in certain files and displays instead weird characters like this: "–í–µ-Ç–µ-Ä –ø-Ä–æ–¥–∏-Ä–∞–µ-Ç –¥–æ –∫–æ-Å-Ç–µ–π." Any ideas why this might be or how I can solve it?

    Yesterday I extracted the subtitles of an MKV file to try and print them. Unfortunately, when I open the .srt file with any text processor, it displays weird characters like the ones included in the title:
    "–û–±—ã–≤–∞—Ç–µ–ª–∏ –ø–µ—á–∞–ª—å–Ω—ã.
    –í–µ—Ç–µ—Ä –ø—Ä–æ–¥–∏—Ä–∞–µ—Ç –¥–æ –∫–æ—Å—Ç–µ–π."
    I thought this had to do with it being an .srt file, but just now I encountered the same problem with an Excel file.
    Any ideas why this might be or suggestions as to how to solve it?
    Thanks in advance,
    Mario

    It looks like an encoding problem.  You should try opening the file in a text editor where you can choose one of the various possible cyrillic encodings (utf-8, koi8-r, iso-8859-5, win-1251, MacCyrillic)

  • My iphone suddenly died as well. Holding the sleep button and home button together got it going again. Any ideas why this happens?

    my iphone suddenly died as well. Holding the sleep button and home button together got it going again. Any ideas why this happened?

    No, I don't think anyone here would know.
    Mine has done that once or twice.

  • I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

    I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

    I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

  • After clicking on my FF shortcut icon on my desktop, it takes FF 30-45 seconds to open. Any ideas why this happens?

    after clicking on my FF shortcut icon on my desktop, it takes FF 30-45 seconds to open. So i sit there and wai and wait and wait until it finally opens. Any ideas why this happens?

    In order to diagnose your problem you will need to download and install the below
    Try clicking the tap problematic apps while the trace is running
    Install the WPT (windows Performance Toolkit) 
    http://www.microsoft.com/en-us/download/details.aspx?id=30652
    Help with installation (if needed) is here
    When you have, open an elevated command prompt and type the following 
    WPRUI.exe (which is the windows performance recorder) and check off the boxes for the following:
    First level triage, CPU usage, Disk IO.  
    If your problem is not CPU or HD then check off the relevant box/s as well (for example networking or registry)  Please configure yours as per the below snip
    Click Start
    Let it run for 60 secs or more and save the file (it will show you where it is being saved and what the file is called)
    Zip the file and upload to us on Onedrive (or any file sharing service) and give us a link to it in your next post.
    Wanikiya and Dyami--Team Zigzag

  • On two occassions, all contacts were wiped off the Ipad. Any ideas why this would happen?

    On two occassions, all Contacts were wiped off the Ipad 2. Any ideas why this would happen?

    Did it happen during a sync or did they just disappear?  After they were gone, we you able to retrieve them during syncing?  Are you using any 3rd party apps to access your contacts or just the built-in Contacts app?
    In any case, I've not heard of or expeienced this on my iPhone 3G (synced with Outlook and now Google) or my iPad, although I've only had my iPad for a short time.

  • The crop tool in my tool bar is not showing up. Any ideas why this is? Please Help

    The crop tool in my tool bar is not showing up. Any ideas why this is? Please Help

    It's the 3rd one on Photoshop standard.  As Curt implies, each little icon position has several possibilities you can display, allowing you some customization of your Tools panel.  Click and hold the mouse button to see each of the choices.
    -Noel

  • HT201412 My camera light is staying on any ideas why this is as its just started to happen

    My camera light is staying on any ideas why this is as its just started to happen and I have no idea what's happened or how to switch it off

    That also indicates a hardware issue with the power and/or home buttons.
    You need to bring the phone to an Apple store and have them check it out.
    ~Lyssa

  • On my Mac (vers 10.7.5) I use Disk Utilites to burn a DVD. The DVD won't play on the Mac but will play on my Windows PC and on a DVD player. A DVD created on my PC will play on the Mac. Any ideas why this is happening?

    On my Mac (vers 10.7.5) I use Disk Utilites to burn a DVD. The DVD won't play on my Mac but will play on my Windows PC and on a DVD player. A DVD created on my PC will play on the Mac. Any ideas why this is happening?

    I used iDVD to create an IMG file
    You created the video DVD, the IMG file, with iDVD and just burned it with Disk Utility. As Klaus1 pointed out Disk Utility can't create video DVDs.
    OT

  • I just upgraded my software to OS X 10.9.2 (13C64) and i can no longer use my printer (epsun stylus sx235w).  any ideas why this would happen?

    i just upgraded my software to OS X 10.9.2 (13C64) and i can no longer use my printer (epsun stylus sx235w).  any ideas why this would happen?

    Mavericks is the name of your operating system. It is otherwise known as OSX 10.9.
    The previous versions were indeed "cat things".
    The way you would know if you need to download new software from Epson is to go the Epson website and search for your printer there, look for downloads, and see if they have new software listed for 10.9.
    You can revert your system back to what it was two weeks ago. This would be easier to do if you have a backup that you made prior to installing Mavericks (like with Time Machine). If you don't have a backup (sounds like you probably don't), you can look here for some directions about how to go back to the "Cat Thing" that you had prior to installing Mavericks: How to revert OS X back from Mavericks: Apple Support Communities
    If all of this is too hard for you, you could take your Mac in to your Apple store and ask them to help you.

Maybe you are looking for

  • Imap - Save a copy in a Folder with Chinese character

    I want to use my Chinese QQ mail account with thunderbird. All directories are named in Chinese. Meaning, that when I use IMAP, Thunderbird can't save a copy in there. Within the settings it won't display the directories I'd see in the webmail versio

  • Add webpart to Wiki page WPZ

    Hi, Is it possible to display a webpart in the hidden webpart zone of a wiki page? I have tried to add but it is not displaying, is this expected? I would want to display a webpart at the bottom of the page. Thanks, Sam

  • IDOC method in LSMW

    how to work on LSMW using IDOC method . can anyone help with an approprite example . i learnt tht inbound processing is to be done before continuing with lsmw steps but is not sure of tht

  • Dynamic Fields and Images

    Hi Folks, I have to prepare some PDFs using indesign that will be used for Invoices. Our developers want to be able to add the logo and certain fields dynamically. I wanted to find out is there anything special i need to know to do to make the fields

  • Round tripping PSD in Cp7/TCS5???

    I'm also continually challenged with round-tripping PSD files in Captivate. I can import a PSD layer, but I can't update the PSD from Cp if the original changes. So I figured that after editing the PSD file I would just import the PSD layer again. Bu