Need to Use MERGE , COPY, or UPDATE  to restore some data

Database:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
Problem:
I screwed up a field, by incorrectly updating a subset of records that should not be touched. We cannot easily restore the field, due to the backup procedure that we use.
As an alternative way to resolve the issue, I want to copy the values from the Routing Master Table and apply them to the Work Order Routing table.
So theoretically we can have 100 distinct masters that are used to up date 1000 records in the other table.
I cannot use the standard update to do this, and I could not successully use nested queries in an update statement. I am also having trouble using a merge.
This problem is not unique (I'm sure) so I need to know what I am doing wrong.
Please help.
Merge:
MERGE INTO wo_rtg
USING (
select wo_rtg.ccn,  wo_rtg.mas_loc,  wo_rtg.wo_num, wo.item, wo.revision,  wo_rtg.wo_line,  wo_rtg.operation,  wo_rtg.oper_type, wo_rtg.op_fix_lt
                         from (( wo inner join wo_rtg
                                  on ( wo.ccn = '1'
                                          and  wo.mas_loc = '1'
                                           and wo.ccn = wo_rtg.ccn
                                           and wo.mas_loc = wo_rtg.mas_loc
                                           and wo.wo_num = wo_rtg.wo_num
                                           and wo.wo_line = wo_rtg.wo_line
                                           and (wo.status = 'R' or wo.status = 'I')
                                           and wo_rtg.oper_type = 'O'
                                           and wo_rtg.op_fix_lt = 5
                                           --and wo.item = '114R2050-35'
                                           --and wo.revision = 'AD'
                                 ) --1
                                    inner join routing rt
                                on ( wo.item = rt.item
                                      and wo.revision = rt.revision
                                        and wo.ccn = rt.ccn
                                        and rt.bcr_type = 'CUR'
                                        and wo_rtg.operation = rt.operation
                                        and trim(rt.bcr_alt) is null
                               ) --2                                    
) e
ON ( wo_rtg.ccn = e.ccn
and wo_rtg.mas_loc = e.mas_loc
and wo_rtg.wo_num = e.wo_num
and wo_rtg.wo_line = e.wo_line
and wo_rtg.operation = e.operation
and wo_rtg.oper_type = e.oper_type
WHEN MATCHED THEN
UPDATE SET r.op_fix_lt = e.op_fix_lt
WHEN NOT MATCHED THEN
insert into reason VALUES ('1','test', 'test test test','test','test','test',1,1,1,sysdate,1,sysdate,'id');
WHERE r.oper_type = 'O'
and r.op_fix_lt = 5I tried this without the WHEN NOT MATCHED & INSERT clauses and the transaction does not work.
Update Syntax:
update wo_rtg
set wo_rtg.op_fix_lt =
select rt.op_fix_lt
     from (( wo inner join wo_rtg
                                  on ( wo.ccn = '1'
                                          and  wo.mas_loc = '1'
                                           and wo.ccn = wo_rtg.ccn
                                           and wo.mas_loc = wo_rtg.mas_loc
                                           and wo.wo_num = wo_rtg.wo_num
                                           and wo.wo_line = wo_rtg.wo_line
                                           and (wo.status = 'R' or wo.status = 'I')
                                           and wo_rtg.oper_type = 'O'
                                           and wo_rtg.op_fix_lt = 5
                                           --and wo.item = '114R2050-35'
                                           --and wo.revision = 'AD'
                                 ) --1
                                    inner join routing rt
                                on ( wo.item = rt.item
                                      and wo.revision = rt.revision
                                        and wo.ccn = rt.ccn
                                        and rt.bcr_type = 'CUR'
                                        and wo_rtg.operation = rt.operation
                                        and trim(rt.bcr_alt) is null
                               ) --2                                    
   ) -- nested select
Where (wo_rtg.ccn, wo_rtg.mas_loc, wo_rtg.wo_num, wo_rtg.wo_line, wo_rtg.operation, wo_rtg.oper_type)
in (
select wo_rtg.ccn,  wo_rtg.mas_loc,  wo_rtg.wo_num, wo.item, wo.revision,  wo_rtg.wo_line,  wo_rtg.operation,  wo_rtg.oper_type, wo_rtg.op_fix_lt, rt.op_fix_lt as rtlt
                         from (( wo inner join wo_rtg
                                  on ( wo.ccn = '1'
                                          and  wo.mas_loc = '1'
                                           and wo.ccn = wo_rtg.ccn
                                           and wo.mas_loc = wo_rtg.mas_loc
                                           and wo.wo_num = wo_rtg.wo_num
                                           and wo.wo_line = wo_rtg.wo_line
                                           and (wo.status = 'R' or wo.status = 'I')
                                           and wo_rtg.oper_type = 'O'
                                           and wo_rtg.op_fix_lt = 5
                                           --and wo.item = '114R2050-35'
                                           --and wo.revision = 'AD'
                                 ) --1
                                    inner join routing rt
                                on ( wo.item = rt.item
                                      and wo.revision = rt.revision
                                        and wo.ccn = rt.ccn
                                        and rt.bcr_type = 'CUR'
                                        and wo_rtg.operation = rt.operation
                                        and trim(rt.bcr_alt) is null
                               ) --2                                    
) {color:#ff0000}ORA-01427: single-row subquery returns more than one row
{color}{color:#000000}__________________________________________________
*Just to show you an idea of what I {color:#00ff00}+really +want to do .*{color}
update wo_rtg
set wo_rtg.op_fix_lt = rt.op_fix_lt
from (( wo inner join wo_rtg
on ( wo.ccn = '1'
and wo.mas_loc = '1'
and wo.ccn = wo_rtg.ccn
and wo.mas_loc = wo_rtg.mas_loc
and wo.wo_num = wo_rtg.wo_num
and wo.wo_line = wo_rtg.wo_line
and (wo.status = 'R' or wo.status = 'I')
and wo_rtg.oper_type = 'O'
) --1
inner join routing rt
on ( wo.item = rt.item
and wo.revision = rt.revision
and wo.ccn = rt.ccn
and rt.bcr_type = 'CUR'
and wo_rtg.operation = rt.operation
) --2
Where wo_rtg.ccn = wo.ccn
and wo_rtg.mas_loc = wo.mas_loc
and wo_rtg.wo_num = wo_rtg.wo_num
and wo_rtg.wo_line = wo_rtg.wo_line
and wo_rtg.operation = rt.operation
Please help!!{color}

Is Flashback a feature of 9i? I can contact our DBA consultant (we don't have one inhouse) and see if he knows anything about this feature.
I tried another suggestio...Executing the Merge by Inserting Null rows and it runs and gives me no errors or warnings. It think it works ... I'm just verifying the data now.
IT all worked out perfectly. Thank you. FYI: For all who are facing the same issue. No null data is actually inserted..It's just a work-around.
MERGE INTO wo_rtg
USING (                    
                    select wo_rtg.ccn,  wo_rtg.mas_loc,  wo_rtg.wo_num, wo.item, wo.revision,  wo_rtg.wo_line,  wo_rtg.operation,  wo_rtg.oper_type, wo_rtg.op_fix_lt, rt.op_fix_lt as rtlt
                         from (( wo inner join wo_rtg
                                  on ( wo.ccn = '1'
                                          and  wo.mas_loc = '1'
                                           and wo.ccn = wo_rtg.ccn
                                           and wo.mas_loc = wo_rtg.mas_loc
                                           and wo.wo_num = wo_rtg.wo_num
                                           and wo.wo_line = wo_rtg.wo_line
                                           and (wo.status = 'R' or wo.status = 'I')
                                           and wo_rtg.oper_type = 'O'
                                           and wo_rtg.op_fix_lt = 5
                                           --and wo.item = '114R2050-35'
                                           --and wo.revision = 'AD'
                                 ) --1
                                    inner join routing rt
                                on ( wo.item = rt.item
                                      and wo.revision = rt.revision
                                        and wo.ccn = rt.ccn
                                        and rt.bcr_type = 'CUR'
                                        and wo_rtg.operation = rt.operation
                                        and trim(rt.bcr_alt) is null
                               ) --2                                    
            ) e
ON (     wo_rtg.ccn = e.ccn
                and wo_rtg.mas_loc = e.mas_loc
                  and wo_rtg.wo_num = e.wo_num
               and wo_rtg.wo_line =  e.wo_line
               and wo_rtg.operation = e.operation
               and wo_rtg.oper_type = e.oper_type
WHEN MATCHED THEN
UPDATE SET wo_rtg.op_fix_lt = e.rtlt
WHEN NOT  MATCHED THEN
  insert (WO_RTG.CCN,
          WO_RTG.MAS_LOC,
          WO_RTG.WO_NUM,
            WO_RTG.WO_LINE,
            WO_RTG.OPERATION)
  values (NULL,
          NULL,
          NULL,
            NULL,
            NULL);Edited by: NCR on Feb 26, 2009 1:01 PM

Similar Messages

  • I have photos on a cd which I'm trying to open .  If I click on them I can see the picture in the preview, but when I double click it doesn't recognise the picture.  They are all in .jpg format.  Tried copying them but it said some data cannot be read.

    I have photos on a cd which I'm trying to open .  If I click on them I can see the picture in the preview, but when I double click it doesn't recognise the picture.  They are all in .jpg format.  Tried copying them but it said some data cannot be read.  The files exist but I just can't seem to view them

    Select one and hit the Space bar to view it in QuickLook. Use the forward arrow keys to move from file to file.   If the file can't be viewed in the QuickLook mode then the file is damaged and probably can't be copied or moved.
    You could try a photo file recovery application like  MediaRECOVER which can scan the memory card and tell you what files, if any, can be recovered before you have to purchase it.
    OT

  • Can Robocopy Be Used To Copy Folders Newer Than A Certain Date?

    We've been using robocopy with the /MAXAGE option to copy files newer than a certain date. Can the same be done for folders?
    Orange County District Attorney

    Hi,
    We cannot use robocopy to folders newer than a certain date, the /MAXAGE option is only used to copy files. We could use PowerShell command to copy folders newer than X days.
    Get-ChildItem <source folder> -Recurse | where {$_.PSIsContainer -eq "ture" -and $_.LastWriteTime -gt ($(Get-Date).Adddays(-X))} | foreach {copy $_.FullName <detination folder> }
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Help - Disconnected Server Setup: Which program do you use to copy the updates off with?

    Hi,
    I am in the process of upgrading our Disconnected WSUS Network up.
    My new configuration is 1 Server running 2012 Datacentre which hosts our online WSUS server and 1 Windows 7 Enterprise PC (both in a workgroup) in the same subnet which has a bluray "robot" burner  to burn the actual updates attached to it. 
    I have to use physical media due to the security policies in place.  My "disconnected" Server is running Server 2008 R2 and is in a domain.
    The problem I have is that previously I used ntbackup on our 2003 R2 Internet connected server, created the full or incremental backup as needed and transferred it to our Server 2008 R2 domain computer.  I then used the ntbackup tool created for server
    2008 to extract the updates.  This has worked fine.
    I thought with Server 2012 R2 I could just use the Windows Server Backup feature as a direct replacement for Ntbackup and transfer the backup.  However when I transfer the backup and attempt to open it on my 2008 R2 server I get a message that the global
    catalog is corrupted.  I tried this a couple of time to make sure I didn't have bad disc's and to rule out a dodgy burner.
    I have now spent the week researching how to fix this and have come to the conclusion that the 2012 backup file is not compatible with the 2008 version of Windows Server Backup.
    I have attempted to recover the catalog using http://technet.microsoft.com/en-us/library/cc725765.aspx but don't get the option too.  I have also ran up some VM's on my test lab with the same configuration and attempted to transfer a couple of MB and these
    failed instead of the 86GB i used initially in work.
    Since I failed at this route I have tried to find another program that can accomplish what I need but have reached a dead end.  I have tried Rich copy but this fails to copy the ACL's over.  I have tried Winrar but I'm not convinced about the ability
    to do a full and incremental backups.  Have also tried wrysnc but again this didn't work.
    Any help with what programs other people use would be very very appreciated.
    Thanks
    Ray

    Hi Ray,
    According to your description, are you looking for compression utilities?
    Due to this forum is focusing on the issue of WSUS, to get better help, please post your question on the Windows backup forum.
    Here is the address,
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=windowsbackup
    Besides, why don't you use the removable hard disk? It's quite fast and cheap.
    Best Regards.
    Steven Lee
    TechNet Community Support

  • Hi experts(I need one badi to copy the ECC to CRM request date forsales ord

    Hi experts,
    I am creating the sales order in ECC Va01 it is getting reflected in CRM (Crmd_order) transaction but when i am creating a Follow-up trans in that i am selecting sales option-->to OCM Quotation the request date at the header level is automatically changed to todays date so i want same date which is there in Va01 request date so please tell be the BADI which one i have to use.
    Urgent requirement.
    Thank you

    I can use it but in that badi the date is same like Va01 request date (REQ_DATE_TZTF) so i cannot changed it i some the the date getting changed to todays date so please give the other badi which solves my problem

  • HT4528 need help with i phone 4 update and restore

    When i was at dinner tpnight my i phone lockrd up and now it says activate and i cannot get to settings menu

    so what have you done to troubleshoot?

  • After updating and restoring some purchased music is "unauthorized"

    I downloaded an update for my Ipod and then was forced to restore my Ipod when it was not recognized by Itunes. After the restoration process I find a few purchased albums come up as not being authorized to play. I go through the process of reauthorization but it does no good. Why would some music no longer be authorized? so far it seems to be that which I had copied to a CD but I have not checked all.

    If you have made sure that both the iTunes and iPod software are current and have deauthorized and reauthorized your computer, try this test:
    1. Deauthorize the computer.
    2. Create a new user in the system.
    3. Download the free song of the week from the iTMS in the new user account.
    4. Play the song in that user account to authorize again.
    5. Restore the iPod (using the iPod updater) in the new user account.
    6. Sync just the free song of the week and see if it plays on the iPod.
    If it does, you appear to have a corrupted iTunes library file, and you should recreate the iTunes library file in your normal user account, and then sync your music back to the iPod and all should be well.
    The following articles will help you.
    About Authorization and Deauthorization.
    How to restore the iPod.
    How to recreate your iTunes library.
    How to create a new user account in Windows.

  • Nokia software update- trouble restoring user date

    G'day.
    I have a nokia n80. when i update the software i lose all of my user data. When i restore it from the back up i lose the new firmware.
    Could anyone help please?

    I have a similar problem; updated my N80 with the software yesterday, restored all the data today, and my applications are now not reachable. The system tells me that the applications are installed, but I cannot find the icons for them, or put them on the standby screen - where I would quite like to find some of them!
    I backed up both to the card and to the laptop, and neither restoration gives me access to my nice programmes.

  • 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

  • Which data sources I need to use for Actual&Plan comparision of GL Account?

    Could you please let me know which datasources I need to use for Actual & Plan comparision of GL Account data?
    Current SAP BI version is BI 7.0.
    As per my knowledge, I am thinking of using the datasources 0CO_OM_CCA_1 for Plan data & 0FI_GL_10 for Actuals.
    Is this right?
    I have one more question here:
    While extracting the data from ds 0CO_OM_CCA_1, I am getting only the Profit & Loss Account data where as the Balance Sheet Account data is not coming.
    And also there is some confusion in VTYPE because the standard ds 0CO_OM_CCA_1 is giving the data with Value type 10 is & Version 000.
    As we all know the VTYPE '10' stands for Actuals then how can we say that this ds 0CO_OM_CCA_1 gives Plan data?
    Please clarify.

    Hi,
    Basically 0CO_OM_CCA_1 data source is used to extract actual, plan, and commitments.
    This data is differentiated with value type, you can see sap note 523742 for more details on value type.
    For balance sheet accounting data check the below link,
    [http://help.sap.com/saphelp_nw04s/helpdata/en/5d/ac7d8082a27b438b026495593821b1/content.htm]
    Regards,
    Durgesh.

  • To find a user exit which update the Invoice header data

    Hi,
    I need a user exit which will update the invoice header data. For eg I need to update the fields RBKP_V-ESRNR and RBKP_V-ESRRE in table RBKP_V. I was using this user exit EXIT_SAPLMRMP_010 (Program ZXM08U16).But this is not working fine as this has no exporting parameter nor tables of structure RBKP_V.
    I need for transaction MIRO.
    Kindly help ...
    Points will be rewarded
    Thanks in advance

    Hi jayasree,
    with the help of the below given program you can find out the requried user exit by giving the T code (MIRO).
    *& Report Z_USEREXIT_DISPLAY *
    Title : Display UserExits *
    Transport Request No : *
    Modification Log *
    ModNo Date Consultant Description of Change(s) *
    REPORT z_userexit_temp
    NO STANDARD PAGE HEADING
    LINE-SIZE 200
    MESSAGE-ID zz.
    T A B L E D E C L A R A T I O N S *
    TABLES: tftit,
    e071,
    e070.
    S T R U C T U R E D E C L A R A T I O N S *
    TYPES: BEGIN OF x_tstc,
    tcode TYPE tcode,
    pgmna TYPE program_id,
    END OF x_tstc.
    TYPES: BEGIN OF x_tadir,
    obj_name TYPE sobj_name,
    devclass TYPE devclass,
    END OF x_tadir.
    TYPES: BEGIN OF x_slog,
    obj_name TYPE sobj_name,
    END OF x_slog.
    TYPES: BEGIN OF x_final,
    name TYPE smodname,
    member TYPE modmember,
    include(15), "Include name
    END OF x_final.
    I N T E R N A L T A B L E D E C L A R A T I O N S *
    DATA: it_tstc TYPE STANDARD TABLE OF x_tstc WITH HEADER LINE.
    DATA: it_tadir TYPE STANDARD TABLE OF x_tadir WITH HEADER LINE.
    DATA: it_jtab TYPE STANDARD TABLE OF x_slog WITH HEADER LINE.
    DATA: it_final TYPE STANDARD TABLE OF x_final WITH HEADER LINE.
    V A R I A B L E S D E C L A R A T I O N S *
    U S E R I N P U T S S C R E E N *
    S E L E C T I O N S C R E E N *
    SELECTION-SCREEN: BEGIN OF BLOCK blk01 WITH FRAME TITLE text-t01.
    PARAMETERS: p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk01.
    S t a r t o f S e l e c t i o n *
    START-OF-SELECTION.
    PERFORM get_tcodes. "Get Tcodes
    PERFORM get_objects. "Get Objects
    E n d o f S e l e c t i o n *
    END-OF-SELECTION.
    PERFORM display_results. "Display Results
    *& Form get_tcodes
    Get Tcodes
    FORM get_tcodes.
    SELECT tcode
    pgmna
    INTO TABLE it_tstc
    FROM tstc
    WHERE tcode = p_tcode.
    IF sy-subrc = 0.
    SORT it_tstc BY tcode.
    ENDIF.
    ENDFORM. " get_tcodes
    *& Form get_objects
    Get Objects
    FORM get_objects.
    DATA: l_fname LIKE rs38l-name,
    l_group LIKE rs38l-area,
    l_include LIKE rs38l-include,
    l_namespace LIKE rs38l-namespace,
    l_str_area LIKE rs38l-str_area.
    DATA: v_include LIKE rodiobj-iobjnm.
    DATA: e_t_include TYPE STANDARD TABLE OF abapsource WITH HEADER LINE.
    DATA: l_line TYPE string,
    l_tabix LIKE sy-tabix.
    IF NOT it_tstc[] IS INITIAL.
    SELECT obj_name
    devclass
    INTO TABLE it_tadir
    FROM tadir FOR ALL ENTRIES IN it_tstc
    WHERE pgmid = 'R3TR' AND
    object = 'PROG' AND
    obj_name = it_tstc-pgmna.
    IF sy-subrc = 0.
    SORT it_tadir BY obj_name devclass.
    SELECT obj_name
    INTO TABLE it_jtab
    FROM tadir FOR ALL ENTRIES IN it_tadir
    WHERE pgmid = 'R3TR' AND
    object = 'SMOD' AND
    devclass = it_tadir-devclass.
    IF sy-subrc = 0.
    SORT it_jtab BY obj_name.
    ENDIF.
    ENDIF.
    ENDIF.
    *- Get UserExit names
    LOOP AT it_jtab.
    SELECT name
    member
    INTO (it_final-name, it_final-member)
    FROM modsap
    WHERE name = it_jtab-obj_name AND
    typ = 'E'.
    APPEND it_final.
    CLEAR it_final.
    ENDSELECT.
    ENDLOOP.
    *- Process it_final contents.
    LOOP AT it_final.
    l_tabix = sy-tabix.
    CLEAR: l_fname,
    l_group,
    l_include,
    l_namespace,
    l_str_area.
    l_fname = it_final-member.
    CALL FUNCTION 'FUNCTION_EXISTS'
    EXPORTING
    funcname = l_fname
    IMPORTING
    group = l_group
    include = l_include
    namespace = l_namespace
    str_area = l_str_area
    EXCEPTIONS
    function_not_exist = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    IF NOT l_include IS INITIAL.
    *- Get Source code of include.
    CLEAR: v_include, e_t_include, e_t_include[].
    v_include = l_include.
    CALL FUNCTION 'MU_INCLUDE_GET'
    EXPORTING
    i_include = v_include
    TABLES
    e_t_include = e_t_include.
    IF sy-subrc = 0.
    LOOP AT e_t_include.
    IF e_t_include-line CS 'INCLUDE'.
    CLEAR l_line.
    l_line = e_t_include-line.
    CONDENSE l_line NO-GAPS.
    TRANSLATE l_line USING '. '.
    l_line = l_line+7(9).
    it_final-include = l_line.
    MODIFY it_final INDEX l_tabix TRANSPORTING include.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDLOOP.
    ENDFORM. " get_objects
    *& Form display_results
    Display Results
    FORM display_results.
    FORMAT COLOR COL_HEADING.
    WRITE:/1(150) sy-uline.
    WRITE:/ sy-vline,
    2(23) 'Extension Name',
    24 sy-vline,
    25(39) 'Exit Name',
    64 sy-vline,
    65(74) 'Description',
    140 sy-vline,
    141(9) 'Include',
    150 sy-vline.
    WRITE:/1(150) sy-uline.
    FORMAT RESET.
    SORT it_final BY name member.
    LOOP AT it_final.
    CLEAR tftit.
    SELECT SINGLE stext
    INTO tftit-stext
    FROM tftit
    WHERE spras = 'EN' AND
    funcname = it_final-member.
    WRITE:/ sy-vline,
    it_final-name COLOR COL_KEY, 24 sy-vline,
    25 it_final-member, 64 sy-vline,
    65 tftit-stext, 140 sy-vline,
    141 it_final-include, 150 sy-vline.
    WRITE:/1(150) sy-uline.
    ENDLOOP.
    Regards
    Srinivas

  • Based on input file i need to update default values to some columns of database table using bulk copy process

    Hi Team,
    Am using BULK INSERT Format file option to load data into table from .txt file here am facing an issue i.e ibased on input file i need to insert default values to some columns of table so we can not declare it on table level, Can we give default values in
    format file ? if we can give how it is ? or Any alternate possibilities to this scenario instead of BULK INSERT ?
    Thanks,
    Sudhakar

    Thanks for your response, here i don't have any rights to change table structure the table is created by different team, my work is to load data from file to table. Is there any chance to supply default values by*XML* format file instead of *.fmt* file
    please let me know the possibility.
    Again, no. If you want to supply default values that are not present in DEFAULT constraints in the table definition, you will need to write your own code. There are plentyfull of options, and I have mentioned some already.
    Here are some more:
    *  Table-valued parameters, see here for examples:
    http://www.sommarskog.se/arrays-in-sql-2008.html
    *  Use BULK INSERT to load data to a staging table, and then apply the default values when you copy from staging to target.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    Hello Arthur,
    Thank you for the reply.
    You were correct that deleting the app and reinstalling it was the only thing to make it work but unfortunately I lost all the documents I made, even though they were backed up to iCloud before i deleted the app. At the same time as deleting pages I had to delete keynote and numbers too, so I've lost all the documents in them too.
    The mb of data which was assigned to each programme in iCloud has reduced, so. I guess they are gone for good. Is there any other way to reaccess them?
    Not your fault but I am a bit fed up the the iPad. I have lost work that I've done and have no other copy apart from what was in iCloud, as I don't have a printer and couldn't email them too myself as I couldn't get into the programme and  i've also got episodes of tv series I purchased that I can't download and albums that are half downloaded with songs missing, so I feel a bit swindled out of time and money and am going back to DVD ,  pen and paper and CDs .
    Instead of using iCloud I guess the only way to make sure I don't loose any more documents it to email them to myself each time I save them on the iPad. Is there anything else you could suggest please?
    I don't have any other apple products apart from iPods, so I can't access the iCloud on anything else can I?
    Thanks
    Amanda

  • I need help! when I am importing my NEF files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support"

    I need help! when I am importing my NEF Raw files from my D3300 camera into lightroom 5 and try to use the "copy as DNG" button I always get an error message saying that "saying the file is not recognized by the raw format support". The whole purpose of that button is so that the file can be recognized... How can I make the "copy as DNG" button work as it is supposed too?? Thank you

    Thank you for responding. So I essentially will never be able to use that button in lightroom 5? do I need to get LR 6? Will there ever be an update for LR 5 that will enable me to use it?
    Does DNG Converter work within LR or do I have to upload pictures to my computer and then make a second copy in DNG format. and then go into LR and use them?
    Thank you @dj_paige

  • Updating lookup table using merge query

    Hi Experts,
    My requirement is, we have total 4 tables called x,y,z and a_lookup table. join column between all these tables is deptno.
    I need to update a_lookup table based on below conditions
       condition1 :   Update a_lookup table with matched records of X and Y
       condition2:    If there is any record in X is not matching with Y, then we need to compare with Z and update the a_lookup table accordingly
    Here is the table scripts and my attempt as well.
    Only doubt is,  is my MERGE statement looks fine or is there any other better way to update the a_lookup table ?
    Please share your thoughts on this.
    create table x(empno number, deptno number);
      -- sample data
      insert into x
        select level, level * 10 from dual connect by level <= 10;
      create table y(empno number, deptno number);
      -- sample data
      insert into y
        select level, level * 10 from dual connect by level <= 5;
      create table z(empno number, deptno number);
      -- sample data
      insert into z
        select level, level * 10 from dual connect by level <= 10;
      create table a_lookup(empno number, deptno_lookup number);
      -- sample data
      insert into a_lookup
        select null, level * 10 from dual connect by level <= 10;
      -- Merging records into a_lookup based on X,Y,Z. Used right outer join on X and Y
    merge into a_lookup a
    using ( (select  x.deptno,x.empno   from x,y where x.deptno=y.deptno)
               union all
               (select z.deptno,z.empno from z, (select x.deptno from x,y where x.deptno=y.deptno and y.deptno is null)  res1
                  where z.deptno = res1.deptno)
               ) res
    on( a.deptno_lookup = res.deptno)
    when matched then
      update set a.empno = res.empno;
    Cheers,
    Suri ;-)

    Assuming empno is unique in X, Y and Z:
    merge
      into a_lookup a
      using (
             select  nvl(y.empno,z.empno) empno,
                     x.deptno
               from  x,
                     y,
                     z
               where y.deptno(+) = x.deptno
                 and z.deptno(+) = x.deptno
            ) b
      on (
              a.deptno_lookup = b.deptno
          and
              b.empno is not null
      when matched
        then
          update
             set a.empno = b.empno
    10 rows merged.
    SCOTT@orcl > select * from a_lookup;
         EMPNO DEPTNO_LOOKUP
             1            10
             2            20
             3            30
             4            40
             5            50
             6            60
             7            70
             8            80
             9            90
            10           100
    10 rows selected.
    SCOTT@orcl >
    SY.

Maybe you are looking for