How to tune this update statement?

Hello

I have to solve the following task:

Update all rows in table A, which has an appropriate row in table B and save what you have done in a table of newspaper.
It is possible that there are several assembly lines in the table has a row in table B.

My first approach is a loop above the table B and do an update of table A for each entry in table B.
It works and looks like this:

Table A:
Number of PK (this is the primary key for this table)
The KEY number

Table B:
Number KEY_OLD
Number KEY_NEW

Table of newspaper:
Number of PK
Number KEY_OLD
Number KEY_NEW
declare
  TYPE PK_TAB_TYPE IS TABLE OF number INDEX BY BINARY_INTEGER;
  v_tab_PK       PK_TAB_TYPE;
  v_empty_tab_PK PK_TAB_TYPE;
begin
  for v_rec in (select * from table_B) loop
    v_tab_PK := v_empty_tab_PK;  /* clearing the array */
    update table_A
    set    KEY = v_rec.KEY_NEW
    where (KEY = v_rec.KEY_OLD)
    returning PK bulk collect into v_tab_PK;
    if (v_tab_PK.count > 0) then
      for i in v_tab_PK.first..v_tab_PK.last loop
        insert into TMP_TAB_LOG(PK, KEY_OLD, KEY_NEW)
          values (v_tab_PK(i), v_rec.KEY_OLD, v_rec.KEY_NEW);
      end loop;
    end if;
  end loop;
end;
Given that the table B can have up to 500,000 entries (and table A has more entries) this solution causes a lot of update statements.

I'm therefore looking for a solution that offers better performance.

My second approach was using a correlated update and looks like this:
declare
  TYPE PK_TAB_TYPE IS TABLE OF number INDEX BY BINARY_INTEGER;
  v_tab_PK            PK_TAB_TYPE;
  v_empty_tab_PK PK_TAB_TYPE;
  v_tab_NewKey    PK_TAB_TYPE;
begin
  v_tab_PK         := v_empty_tab_PK;  /* clear the arrays */
  v_tab_NewKey := v_empty_tab_PK;
  update table_A a
  set    KEY = (select KEY_NEW from table_B where (KEY_OLD = a.KEY))
  where exists (select 'x' as OK
                     from   table_B
                     where (KEY_OLD = a.KEY)
                    )
  returning PK, KEY bulk collect into v_tab_PK, v_tab_NewKey;
  if (v_tab_PK.count > 0) then
    for i in v_tab_PK.first..v_tab_PK.last loop
      insert into TMP_TAB_LOG_DUB(PK, KEY_OLD, KEY_NEW)
        values (v_tab_PK(i), null, v_tab_NewKey(i));
    end loop;
  end if;
end;
Now, I found that a single update.
The only thing missing in this second approach is the old KEY before the update in the log table.
But I have no idea how to do to get the old value.
Is it possible to change this second approach to get the old value of the KEY before the update to write it in the table of the newspaper?

And now I need your help:
What is the best way to get a high-performance solution for my task?

Any help is appreciated.

Hartmut cordially

Have you tried my advice to make a UNIQUE on table_B (KEY_OLD) index?

Oracle wants to make sure that the update statement are left with two different values for the update of a line:
The keys must be preserved in the online posting.

Tags: Database

Similar Questions

  • How to install this update and resolve problems of USB and the touchpad?

    I Equium M50 (59th) and am bitten by an update that pulled my touchpad and keyboard. I did the new installation of XP Home and have all updated drivers and everything goes well. The last update, what I can't understand is for
    Ana _2005_10_24_V1.2 driver is for, Standard Open HCD USB Host Controller... X 2 .........

    The update addresses all kinds of questions like I'm having and is an update recommended driver detective, I use offten.

    The problem is that it says uninstall the drivers for the i have installed already and when I do it it hits off my USB mouse me leaving no able to install the new. When I reboot it installs those I don't want not reinstalled.

    This is the read me, off the coast of the new update and really I don't understand to underdstand what to do... .so here it is?
    Driver revision history:
    Twinhan VP704A Driver Release Notes
    -------------------------------------------------------------------------------
    Note:
    1. in the event that the system hangs when running with VP704A, please install ULI
    Host USB 2.0 in \ULiUSB20Driver driver

    2. for XP/SP1, please update with the patch in

    3. in XP/SP1, update driver will crash the system, while the new facility is ok.
    The trick to update driver XP/SP1 is illustrated in the following steps,
    a. uninstall the driver
    b. disconnect and reconnect the USB device
    c. install the driver
    4 to support the controller remotely, please launch Agent.exe in \Agent.
    Further details at \Agent\Readme.txt

    Known issues:
    1 multi-instance is not supported
    2 remote wakeup is not supported
    3. strong use of the processor from analog video/audio capture
    4. bad Signal using color YUY2 format IST
    5 AV sync if audio captured the wrong filter.
    (Difficulty: use the filter "USB Audio Device" in the flow WDM capture device)
    6. noise with analog TV and FM Radio
    (Difficulty: use the filter "USB Audio Device" in the flow WDM capture device)

    Driver revision history:
    -------------------------------------------------------------------------------
    2005-10-24, version: 1.0.2.8
    Bugs fixed and new features:
    1 is not correctly configured.
    -------------------------------------------------------------------------------
    2005-10-21, version: 1.0.2.7
    Bugs fixed and new features:
    1. the firmware version read FLASH OK!
    -------------------------------------------------------------------------------
    2005-10-14, version: 1.0.2.6
    Bugs fixed and new features:
    1.MUtil - access driver empty part lower part of screen when IST!
    2.MUtil - access HCT pilot check fix crash!
    -------------------------------------------------------------------------------
    2005-10-07, version: 1.0.2.5
    Bugs fixed and new features:
    1 tuner turns off when S-Video, Composite.
    -------------------------------------------------------------------------------
    30/09/2005, version: 1.0.2.4
    Bugs fixed and new features:
    1.agent.exe update for repeat bug!
    2.TI5150 sign up to fix video Format!
    -------------------------------------------------------------------------------
    2005-09-29, version: 1.0.2.3
    Bugs fixed and new features:
    1.A pilot of the trial build for multiple access medium. (in the folder "\Multi-Access")
    Note: The filter 'Audio device USB' provided by the system does not support mutil-access.
    2 reset TI5150 when a new frequency is defined
    -------------------------------------------------------------------------------
    2005-09-27, version: 1.0.2.2
    Bugs fixed and new features:
    1. difficulty I2C unstable access on some devices.
    -------------------------------------------------------------------------------
    2005-09-23, version: 1.0.2.1
    Bugs fixed and new features:
    1. analog TV becomes sometimes darker.
    -------------------------------------------------------------------------------
    15/09/2005, version: 1.0.2.0
    Bugs fixed and new features:
    1. difficulty of installation INF for Windows 2000.
    2 FM scan radio policy changed!
    -------------------------------------------------------------------------------
    13/09/2005, version: 1.0.1.9
    Bugs fixed and new features:
    1 USB string serial number not visible with USBView, updated firmware required.
    2. political analysis of FM radio, return of release if PLLOffset > = 9 x 12. 5 kHz
    -------------------------------------------------------------------------------
    13/09/2005, version: 1.0.1.8
    Bugs fixed and new features:
    1. after the passage between AV/D/A several times, video display becomes dark in THDTV 2.61
    -------------------------------------------------------------------------------
    12/09/2005, version: 1.0.1.7
    Bugs fixed and new features:
    1. improve the performance of check channel lock status
    2 pinnacle INF Fix.
    -------------------------------------------------------------------------------
    2005-09-09, version: 1.0.1.6
    Bugs fixed and new features:
    1. Add an audio initialization function.
    -------------------------------------------------------------------------------
    2005-08-31, version: 1.0.1.5
    Bugs fixed and new features:
    1 separation of PAL and NTSC resolution mode.
    -------------------------------------------------------------------------------
    2005-08-30, version: 1.0.1.4
    Bugs fixed and new features:
    1.AvgTimePerFrame.
    2 frame drop.
    3 pinnacle inf file HCT chkinf fail.
    -------------------------------------------------------------------------------
    2005-08-22, version: version 1.0.1.3
    Bugs fixed and new features:
    1. add remote control interface in digital source filter.
    2.A new remote test tool that contains of the source code in \Test_RC.
    -------------------------------------------------------------------------------
    2005-08-16, version: 1.0.1.2
    Bugs fixed and new features:
    1. Pinnacel & Twinhan driver & file reorg.
    2.VP704A_BDA_Test tool, add a test to the system code.
    3. set the standard infrared protocol of "IRSTANDARD", "IRSYSCODECHECK1" registry keys in the INF file.
    4 firmware update
    -------------------------------------------------------------------------------
    2005-08-15, version: 1.0.1.1
    Bugs fixed and new features:
    1 serial number feature is lost when the audio volume of the TV control
    2.RC6A support CIR
    (This firmware uses GPIO3 (M9207 pin 80) to decode the RC6 Protocol.
    The material must be reworked to connect the M9207 80 pin to the CIR module and the actual
    EEPROM must be flashed with \Firmware\M9207.bin)
    3 Serieal, MAC address and name of device OEM taken in charge.
    Please see for more details on the \Firmware\readme.txt.
    4 Ioclt example source code included.
    -------------------------------------------------------------------------------
    08/08/2005, version: 1.0.0.10
    Bugs fixed and new features:
    1. increase audio volume analog TV.
    -------------------------------------------------------------------------------
    04/08/2005, version: 1.0.0.9
    Bugs fixed and new features:
    1. analog TV Video mode failed.
    -------------------------------------------------------------------------------
    2005-08-03, version: 1.0.0.8
    Bugs fixed and new features:
    1.off - centerf frequency scan + / 125Khz
    2 difficulty program a copy scanned in MCE.
    -------------------------------------------------------------------------------
    02/08/2005, version: 1.0.0.7
    Bugs fixed and new features:
    1.THBDAConsole.exe 'ulFixedBW', 'ulDisableOffFreqScan', 'ulMCEFreqTranslate' bug
    -------------------------------------------------------------------------------
    2005-07-28, version: 1.0.0.6
    Bugs fixed and new features:
    1.THBDAConsole.exe 'ulFixedBW', 'ulDisableOffFreqScan', 'ulMCEFreqTranslate' support
    2. improve the stability of I2C communication.
    3 unify signaling resistance & quality as a THBda ioctl interface.
    4 capture filter lock state control.
    -------------------------------------------------------------------------------
    2005-07-28, version: 1.0.0.5
    Bugs fixed and new features:
    1. the same strength & quality signals as VP7046.
    2 debug build pilot
    -------------------------------------------------------------------------------
    2005-07-21, version: 1.0.0.4
    Bugs fixed and new features:
    1. put the INF update.
    -------------------------------------------------------------------------------
    2005-07-20, version: 1.0.0.3
    Bugs fixed and new features:
    1 improve performance in PCM4
    2 passage of the analog TV Mode to FM Mode failure
    -------------------------------------------------------------------------------
    2005-07-04, version: 1.0.0.2
    Bugs fixed and new features:
    1. production tool FM test OK!
    --------------------------------------------

    And here is the Readme file from the other file in the update?

    ************************************************** ************************************************
    ULi PCI to USB Enhanced Host Controller Driver V1.72 for Windows 98 SE, Windows ME, Windows 2000 and Windows XP
    ************************************************** ************************************************

    ----------------
    INTRODUCTION
    ----------------

    This driver supports the host EHCI ULi controller under Windows 98 SE, Windows ME, Windows 2000
    and Windows XP.

    -------------------------
    CONTENTS OF THIS DOCUMENT
    -------------------------

    1. installation instructions
    2. uninstall instructions

    ----------------------------
    1. installation instructions
    ----------------------------

    (Windows 98SE & Windows ME)
    ULi USB 2.0 Controller has strapped on the system
    1. install the driver USB 2.0 ULi
    -Run the Setup program.
    -This program will copy the driver files in your Windows system, and then restart your computer.
    2. after the system restarts, Windows will detect the new hardware 'ULi PCI to USB Enhanced
    Host Controller"and install the driver.

    B.If any ULi USB 2.0 on the system controller
    1. install the driver USB 2.0 ULi
    -Run the Setup program.
    -This program will copy the driver files to your Windows system, then turn off your computer.
    -Fix the ULi USB 2.0 computer controller card and restart your computer.
    2. after the system restarts, Windows will detect the new hardware 'ULi PCI to USB Enhanced
    Host Controller"and install the driver.

    (Windows 2000)
    ULi USB 2.0 Controller has strapped on the system
    1. install the driver USB 2.0 ULi
    -Run the Setup program.
    -This program will install and load the driver and you do not have to restart the
    computer.
    B.If any ULi USB 2.0 on the system controller
    1. install the driver USB 2.0 ULi
    -Run the Setup program.
    -This program will copy the driver in your Windows system files, before turning itself off
    your computer.
    -Fix the ULi USB 2.0 computer controller card and restart your computer.
    2. after the system restarts, Windows will detect the new hardware 'ULi PCI to USB Enhanced
    Host Controller"and install the driver.

    (Windows XP)
    ULi USB 2.0 Controller has strapped on the system
    1. install the driver USB 2.0 ULi
    -Run the Setup program.
    -Click "NEXT".
    -This program will install and load the driver and you do not have to restart the
    computer.
    -Once install the driver ULi USB 2.0 successfully. System will detect "USB 2.0 Root '.
    Hub. " Please select "Install the software automatically (recommended)" and then
    Click 'Next' to continue the installation.
    -This program will install and load the driver and you do not have to restart the
    computer.
    B.If any ULi USB 2.0 on the system controller
    1. install the driver USB 2.0 ULi
    -Run the Setup program.
    -This program will copy the driver in your Windows system files, before turning itself off
    your computer.
    -Fix the ULi USB 2.0 computer controller card and restart your computer.
    2. after the system restarts, Windows will detect the new hardware 'ULi PCI to USB Enhanced
    Host Controller', proceed with the installation.
    -Once install the driver ULi USB 2.0 successfully. System will detect "USB 2.0 Root '.
    Hub. " Please select "Install the software automatically (recommended)" and then
    Click 'Next' to continue the installation.

    Notice:
    If you can not configure driver successfully. Please restart your system, then follow
    steps to reinstall driver above.

    ------------------------------
    2. uninstall instructions
    ------------------------------

    1. open the "Control Panel" folder.
    2 call the "Add/Remove Programs" icon
    3 choose the "ULi USB2.0 Driver" section.
    4. click on the "add/delete" button to remove drivers.

    -----------------------------------
    Change list:
    -----------------------------------
    1.74
    1 fix this multi-interface keyboard may not be detected on the USB 2.0 hub.
    2. support all USB2.0 Host Controller.
    1.73
    1 problem on Win98SE, blue screen when you unplug a USB 2.0 Scanner after scanning image.
    2 solve problem on Win98SE, blue screen when you unplug a few Scanner USB 2.0 USB 2.0 Hub after scanning image.
    3 fix on Win98SE, blue screen when copying of files through the hub of UH-204 SUNBOX.
    4 solve problem as wirless lan will disconect when the plug in usb device.

    1.72
    1 fix that system crash when HD USB copy large files.

    1.71
    1. improve the management of power in Win98 / Me.

    1.70
    1. improve the devcie detection function.

    1.62
    1 solve the problem that can not operate a USB HUB USB 2.0 disk when the system resume inactive.

    1.61
    1 solve the problem that some device under USB 2.0 HUB is not found if resumes suspension system.

    1.60
    1. in support of functions power management when a HUB with the USB plug in device
    a root HUB.

    1.57
    1. Fix USB with USB 2.0 HUB floppy cannot detect problem.
    2. fix audio problem that can not display smooth when peripheral USB connect to the system.
    3. fix system cannot detect DVICE USB when the USB device attached to the system in
    suspend mode.
    4 fix when root USB HUB have a full load, USB HD sometimes
    failure of the transaction.

    1.56
    1 fix that device of DVD decoder cannot display correctly.

    1.55
    1. fix OTI USB 2.0 drive hand cannot detect question.
    2. attach the USB mouse cannot be used after the resumption of hanging.

    1.54
    1. to improve the safety of the driver.

    1.53
    1. transfer bulk fix may stop if the USB device is connected to the USB 2.0 hub
    2 difficulty USB 2.0 mass storage device cannot access after the release of the standby mode if there is an another USB 1.1 existing device

    1.52
    1 correct fault of system pages when accessing the storage of mass Win98SE or scandisk device failure when selecting
    automatically fix file system errors
    2. fix system may hang on in Win98SE / ME if USB 2.0 cardbus card is plugged

    v.1.51
    1. to improve the compatibility of USB 2.0 card reader.
    2. fix USB IDE devices are not accessible after the release of the standby/hibernation mode.

    v1.50
    1. improve the transfer block

    v1.48
    1. difficulty of installation of the USB 2.0 LAN driver hangs up
    2. attach a USB 1.1 card reader cannot be identified when plugged into the USB 2.0 hub
    3. fix some laptops starting hanging Win98SE

    v1.47
    1. improve the performance of bulk transfer.
    2. fix the failure of USB 2.0 Preview in bulk webcam.

    v1.46
    1. support USB 2.0 and 1.1 devices isochronous
    2. fix system hang up when restarting system if the USB 2.0 host controller is disabled in Win9X / ME
    3. fix system hang up when you uninstall the driver if there is USB 2.0 connected under Win2K/XP devices
    4. improve the capacity of the device detection in Win9X / ME

    v1.45
    1. fix system hang up when the mode standby ACPI.
    2. attach the mouse sometimes does not disappear when it is unplugged.
    3. fix the failure of detection of composite devices Win9X and improve device composite Win2K/XP

    v1.44
    1. composite crutch
    2 improve the detection of devices

    v1.43
    1 improve the failure rate of transfer IDE read/write with USB 2.0 to IDE bridge on the platform of PC card
    2 difficulty at high peripheral speed detected as full-speed device
    3. fix some problem of failure detection USB mouses
    4. fix some problem USB 2.0 Hub failure detection
    5 difficulty Win98SE crashing if ULi EHCI 1.42 is installed

    v1.42
    1. fix PC Card eject hang up in Win98 / ME
    2 difficulty of interruption/resumption hang up in Win98
    3 sometimes solve USB 1.1 device cannot be detected if OS starts with USB 2.0 and 1.1 devices plugged
    4. fix some failure detection of PC Card USB 1.1 devices

    v1.41
    1. Add new feature that system can install the driver ahead of the device is plugged in.
    2. fix PCMCIA OHCI controller resources affect problem on Windos ME.

    v1.40
    1. support Win9X/ME / 2 K/XP with ULi USB 2.0 driver.
    2 fix PCMCIA EHCI controller detection device USB 2.0 problem in Win9X / me.

    v1.32
    1. Fix problem that pilot cannot detect the Microsoft driver in Windows XP
    If the path of the OS is not c:\windows.
    2. Fix problem that pilot cannot detect the USB 2.0 controller device in a system.

    v1.31
    1. Fix problem that driver cannot install on Windows 2000.

    v1.30
    1 fix than Win9X / shows ME no USB 2.0 hub.
    2 solve the problem that hang up when the second entry in Win9X S1 with HID device connected.
    3 Fix problem that sometimes when you click on "search the hardware changes.
    for PNP ULi USB2.0, controller, the system will inform you the usbehci.sys
    file is not found.
    4. Fix problem that v1.20 can't find no EHCI controller to install the driver for after different
    verison of ULi EHCI controllers devices are connected and disconnected.
    5 install the driver support for several features of controller EHCI ULi existing on
    system at the same time.
    6. determine Win2K/XP shows hub USB root for USB 2.0 hub.

    v1.20
    1. support ULi USB 2.0 for Windows 98SE/ME/2000/XP host controller driver.

    ULi Coporation. (ULi) web sites:
    http://www.Uli.com.tw/ (Taiwan)

    CAN SOMEONE TREAT ME LIKE A CHILD OF TWO YEARS AND GIVE SOME ADVICE AS TO HOW TO OBTAIN THIS UPDATE.

    I'D VERY GRATEFULL AND KIND OF THINK IT would BE BENEFICIAL to a LOT MORE than PEOPLE LIKE I SEE a LOT OF XP AND PROBLEMS OF THE KIND THIS UPDATE IS SUPPOSE to FIX.

    It is said above 2 relevant and 1 right ANSWER available...

    I'm new here, so anyone could direct me to these answers?

  • A security update for windows THAT XP cannot install (KB2707511). Code received the error 0x80076BE. How to install this update?

    A security update for windows THAT XP cannot install (KB2707511). Code received the error 0x80076BE. How to install this update?

    Hello

     
    You are able to install other updates successfully?
     
    See the methods mentioned below and check if that helps.
     
    Method 1: Temporarily disable the security software.

    Note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you do not disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network during the time that your antivirus software is disabled, your computer is vulnerable to attacks.

    Method 2: put the computer in a clean boot state to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Note: After completing the troubleshooting steps in the clean boot, follow steps to configure Windows to a Normal startup State of the link section to return the computer to a Normal startup mode.

    Method 3: Follow the steps in the article.

    How to reset the Windows Update components?

    Method 4:
     
    You cannot install updates from Windows Update, Microsoft Update, or by using the auto update after a repair of Windows XP after installing Windows XP SP3 immediately after a clean installation of Windows XP SP2 or
    Hope this information helps.
  • Failed installation error Code 80070490 Windows Vista update KB976098. How to install this update or keep the windows to try to re - install?

    Failed installation error Code 80070490 Windows Vista update KB976098.  How to install this update or keep the windows to try to re - install?

    http://support.Microsoft.com/kb/958044

    You receive an error code "0 x 80070490" when you use Microsoft Update or Windows Update Web sites to install updates

    Windows Update Forum:

    It comes with Vista, upgrade install and activate Forum.

    You will get the best help for any problem of Update/Service Pack in the Windows Update Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon.

    Mick Murphy - Microsoft partner

  • How to optimize the update statement so that the query is reading the same table?

    Hi all

    I have a process with the following UPDATE statement:

    Sales_val update

    SET ship_date =)
    Select max (hist.ship_date)

    FROM sales_hist hist

    WHERE hist. X_ID = A.X_ID

    AND hist. X_VAL = A.X_VAL)

    ) WHERE EXISTS (select * from sales_hist hist where )

    WHERE hist. X_ID = A.X_ID

    AND hist. X_VAL = A.X_VAL

    )

    sales_val - 50 lines mln (unique index)

    sales_hist - 20 mln ranks (unique index)

    I met many problems with waits and locks - how to optimize to avoid locks using the parameters of tables or changes of the declaration? or maybe is there another way to do optimization ?

    Kind regards

    Bolo

    Thank you for that. Collect in bulk Unfortunatelly + FORALL does not work with the types in 10g - solution is to use the FOR loop and is not as effective as FORALL in many cases. I do still some tests to solve this problem - I'll put you once it's done.

    EDIT: hash partitioning + fusion - 3-5 minutes (time), so for now it's the solution to the problem. Thank you all for the great discussion!

  • How to get a update statement faster?

    Hello together,

    I have an update statement on a view in line composed of two tables A and B.

    He works and updates the table column has a value of the corresponding entry in the table B.

    This 1,800,000 update records in table A are updated.

    The table, there are a few clues.

    If I drop the update indexes is much faster (instead of 2,5 hours, that just 0.5 hour).
    But the time needed to re-create the index is much more that I saved thanks to the removal of the index. (4 hours!)

    So I do not remove the indexes and perform the update.

    My update statement runs in mode RBO a uses the FULL (A) - tip to prevent oracle to use the index when you create the inline view (connecting A and B).

    It made a difference for the execution of the update statement if it runs in either CBO or RBO mode?

    What can I do to get faster update statement?

    Thank you very much in advance for any help.

    Hartmut cordially

    You can probably tune.

    Here's a guide that should be useful...

    When your query takes too long...

  • How to convert this select statement in the update

    Hai All

    I have two tables namely Daily_attend, Train_mast

    The Daily_attend are made up of fields are Train_mast are made up of fields are

    Name varchar form no var

    Date of empcode Num V_DATE

    Intimate Date Train_name var

    Outtime date Late_hrs var

    Number IND_IN

    Number IDE_OUT

    Date of Attend_date


    I need to update the table Depend of IDE_IN in Daily_attend in late_hrs in the Train_mast table

    I got through in the select statement, it is my select statement

    Select to_number (TO_DATE (TO_CHAR(Intime,'DD-MON-YYYY') |)) » '||
    To_char (0815, '0000'), 'MON-DD-YYYY HH24') + late_hrs /(24*60)-respondent
    ) * 24 * 60 dail_Att, train_mast;

    How can I convert to update

    Any help is highly appricateable

    Thanks in advance

    Concerning

    Srikkanth.M

    Srikkanth,

    Try this code. And 1 thing, I don't see any WHERE condition to join between the 2 tables, DAIL_ATT, TRAIN_MAST.

    UPDATE DAIL_ATT A SET A.IDE_IN = (SELECT TO_NUMBER(TO_DATE(TO_CHAR(INTIME, 'DD-MON-YYYY')|| ' ' || TO_CHAR(0815, '0000'), 'DD-MON-YYYY HH24:MI') + LATE_HRS / (24 * 60) - INTIME) * 24 * 60 FROM TRAIN_MAST B WHERE );
    

    Kind regards

    Manu.

    If my answer or the answer to another person has been useful or appropriate, please mark accordingly

  • How to make this update?

    I am unable to run the below update, what could be the problem?

    SQL > update (select b.paramvalue FROM sairepo. STORE_JOB_DETAILS b, sairepo.job_prop a

    WHERE a.jobid = b.jobid and a.PARAMNAME = "PLEVEL".

    and a.jobid in

    (select id from sairepo.job_dictionary where jobid as ' use %')))

    Set a.paramvalue = b.paramvalue;  2 3 4 5

    Set a.paramvalue = b.paramvalue

    *

    ERROR on line 5:

    ORA-00904: "B". "" PARAMVALUE ": invalid identifier

    SQL >

    SQL >

    SQL > update (select b.paramvalue FROM sairepo. STORE_JOB_DETAILS b, sairepo.job_prop a

    WHERE a.jobid = b.jobid and a.PARAMNAME = "PLEVEL".

    2 3-a.jobid in

    (select id from sairepo.job_dictionary where jobid as a 'Use %')

    4 5)

    6 set job_prop.paramvalue = STORE_JOB_DETAILS.paramvalue;

    Set job_prop.paramvalue = STORE_JOB_DETAILS.paramvalue

    *

    ERROR on line 6:

    ORA-00904: "STORE_JOB_DETAILS." "" PARAMVALUE ": invalid identifier

    I am unable to run the below update, what could be the problem?

    The problem is that A and B alias are out of reach in your SET clause, they can only be referenced from within the online opinion.

    Assuming that the join is actually editable (see policies here: http://docs.oracle.com/database/121/ADMIN/views.htm#i1006318), you can use something like this:

    update (
      select a.paramvalue as old_value
           , b.paramvalue as new_value
      from sairepo.store_job_details b
         , sairepo.job_prop a
      where a.jobid = b.jobid
      and a.paramname = 'PLEVEL'
      and a.jobid in (
        select id
        from sairepo.job_dictionary
        where jobid like 'Usage%'
      )
    )
    set old_value = new_value ;
    

    or use a MERGE statement.

  • Help! How to "downgrade" this update? This version is not supported by a computer program that I use for work. Thank you!

    Is there a way to uninstall the update of Firefox? I already had a problem with this program because it was not compatible with the latest version of IE.

    Hey jpgaprilfool,

    There are many benefits to the latest version of Firefox. Out of curiosity, what program is not compatible with the new Firefox? You should consider your comments for developers so that they can continue to improve the product.

    If you want to roll back to a previous version of Firefox, just take a glance section of the Knowledge Base install an older version of Firefox.

    Hope this helps!

  • How to remove security as States update can not be removed

    KB956844-security update causes errors with software we use, in Add Remove programs this update States cannot be removed.

    How to reslove this problem?

    Help us help you: start by reading this post 'sticky '...

    What information to post in the Windows Update forum
    http://social.answers.Microsoft.com/forums/en-us/vistawu/thread/1467f44b-ee27-4F7D-98d7-f1c4b35b3395

    =========================================

    Visit the Microsoft Solution Center and antivirus security for resources and tools to keep your PC safe and healthy. If you have problems with the installation of the update itself, visit the Microsoft Update Support for resources and tools to keep your PC updated with the latest updates.

    NB: for Windows 2000 SP4 extended support ends on July 13, 2010.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Cancellation-TBS and very large update statements

    Hello

    to be sure that I'm right...

    Currently, it need to update a table with 230.000.000 lines. A single statement attempted to update 14.000.000 lines, but this update statement failed after 29 hours with ORA-015555.

    1 how long Undo-TBS store blocks? Only until the validation of the actual transaction, isn't?

    2. on the table, we have 7 index on columns. Is it true, that we can reduce the amount of Undo-SCT for this operation if we remove some clues?

    Kind regards

    Mark

    Ask DBA_SEGMENTS or DBA_ROLLBACK_SEGMENTS for segments Undo and V$ UNDOSTAT for usage of Cancel.

    Hemant K Collette

  • The UPDATE statement: view Multi level Inline.

    This is the test case.
    create table source(old_val integer, new_val integer)
    / 
    create table target(val integer)
    / 
    insert into target values(1)
    / 
    insert into target values(2)
    / 
    insert into target values(3)
    / 
    insert into source values(1,4)
    / 
    insert into source values(1,5)
    / 
    insert into source values(2,6)
    / 
    insert into source values(3,7)
    / 
    insert into source values(3,8)
    / 
    commit
    / 
    Now I want to update target.val with source.val and the corresponding condition is source.old_val = target.val

    But source.old_val can have multiple values for a given target.val. You can see in the example. I would like to order by ROWID of source and choose the first record.

    So I wrote an UPDATE.
    SQL> update target t
      2     set (val) = (select new_val
      3               from (select new_val, row_number() over(order by rowid) rno
      4                       from source s
      5                      where s.old_val = t.val)
      6              where rno = 1)
      7   where exists(select null
      8             from source s
      9            where t.val = s.old_val)
     10  / 
     
    3 rows updated.
    and that's what I got.
    SQL> select * from target
      2  / 
     
           VAL
    ----------
             4
             4
             4
     
    SQL> select * from source
      2  / 
     
       OLD_VAL    NEW_VAL
    ---------- ----------
             1          4
             1          5
             2          6
             3          7
             3          8
    I expected the updated as 4,6,7 or 5,6,8 value but don't know why its 4,4,4.

    Just try to understand how this update is underway. Not sure if I am missing something basic.

    NOTE: I'm interested in the behavior of this update statement and not another method to solve the problem.

    Thank you

    Knani.

    Well, I think that it is related to the #374632.1 bug, already discussed in [this thread | http://forums.oracle.com/forums/thread.jspa?messageID=2134151]
    In short, your case should return the error I, ORA - 904.

    Nicolas.

  • How to hide an update of safety

    I had problems with the rendering of fonts in Chrome and Firefox which has been fixed by uninstalling the update KB3013455. Now he has reinstalled himself and tries to make me restart so it can end up being installed. How to block this update? In my view, it is marked as important, but the only solution to the problem of display has been uninstall. I couldn't see a hide option, only an option to view more about this update.

    Should I uninstall every day?

    Any help is very appreciated.

    Open Control Panel > programs > uninstall programs > view installed updates > find and
    Uninstall KB3013455 > restart the computer > Open Windows Update >
    Look for the updates > under downloads find KB3013455 right click and HIDE.

    `~`

  • Update statement with multiple joints

    Hello

    I use Oracle 12 c and here my Question:

    /*

    ledgerstb is an Oracle the ITO (TransNo column is the primary key)

    vledgerstb_gtt is a global temporary Table

    vledgervc_gtt is a global temporary Table

    */

    UPDATE

    (, SELECT ledgerstb. TransNoVC AS TransNoVC_Old,

    vledgervc_gtt.transnovc AS TransNoVC_New

    OF ledgerstb

    INNER JOIN vledgerstb_gtt ON ledgerstb. TransNo = vledgerstb_gtt.transnostb

    INNER JOIN vledgervc_gtt ON ledgerstb. STBNo = vledgervc_gtt. STBNo

    ) T

    SET T.TransNoVC_OLD = T.TransNoVC_NEW;

    This update statement gives the following error message:

    Error report-

    ORA-01779: cannot modify a column that is mapped to a table not preserved key

    ORA-06512: at "RELYC. STBPKG', line 597

    ORA-06512: at line 201 level

    01779 00000 - 'impossible to change a column that is mapped to a non-preserved table at key'

    * Cause: An attempt was made to insert or update columns in a join finds out who

    map to a table not kept the key.

    * Action: Change the directly underlying base tables.

    For your reference, the following result internal instruction select (in blue color police) give;

    TransNo: 1 STBNo: VAAAABM315711131

    TransNo: STBNo 2: VAAAABM315711214

    TransNo: STBNo 3: VAAAABM315711262

    TransNo: STBNo 4: VAAAABM316410986

    Please suggest if I'm doing something wrong or it is not possible to update the table like that.

    (I know that I can use ForAll Update statement, but I do not want to use Collections here.)

    Thank you carine, finally I found my answer,

    the update query requires that each record that will be updated should be updated only once. so if I do join 1<->1 it updates successfully.

    Thanks to all who contributed, or at least tried. Thanks again.

  • Update statement is a coherent lof 'Get '.

    Hello

    When I run this update statement, it generates a lot of 'get in line ':

    UPDATE PFA_FUSIONFACC WAS

    SET (COD_FACTURA, TOT_CARGO_DB, TOT_CARGO_FB) =

    (SELECT THE NPC. COD_FACTUcaRA AS COD_FACTURA, NPC. TOT_BASEIMPO_E AS TOT_BASEIMPO, NPC. TOT_IMPEMI AS TOT_IMPEMI

    OF NPC, CTA AUX_CTAFACTU PFA_NPCOFACTMES

    where LTC. CTA_FACTURAC = WAS. CTA_FACTURAC

    AND NPC.cod_postal = CTA.cod_postal

    AND NPC.cta_facturac = CTA.cta_facturac)

    where FUS.rowid in

    (SELECT WAS.) ROWID

    NPC PFA_NPCOFACTMES, CTA AUX_CTAFACTU, WAS PFA_FUSIONFACC

    where LTC. CTA_FACTURAC = WAS. CTA_FACTURAC

    AND NPC.cod_postal = CTA.cod_postal

    AND NPC.cta_facturac = CTA.cta_facturac

    AND ROWNUM < 10000);

    9999 filas actualizadas.

    Passed: 01:38:15.47

    Run plan

    ----------------------------------------------------------

    Hash value of plan: 2048200947

    ----------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                | Lines | Bytes | TempSpc | Cost (% CPU). Time | Pstart. Pstop |

    ----------------------------------------------------------------------------------------------------------------------------------

    |   0 | UPDATE STATEMENT.                     |     1.    62.       |   117 KB (4) | 00:23:27 |       |       |

    |   1.  UPDATE                            | PFA_FUSIONFACC |       |       |       |            |          |       |       |

    |   2.   NESTED LOOPS |                     |     1.    62.       |   117 KB (4) | 00:23:27 |       |       |

    |   3.    VIEW                            | VW_NSO_1 |  9999 |   117 KB |       |   117 KB (4) | 00:23:27 |       |       |

    |   4.     UNIQUE FATE |                     |     1.   478K |       |            |          |       |       |

    |*  5 |      COUNT STOPKEY |                     |       |       |       |            |          |       |       |

    |*  6 |       HASH JOIN |                     |   774K |    36 M |    86 M |   117 KB (4) | 00:23:27 |       |       |

    |   7.        NESTED LOOPS |                     |  2258K |    60 M |       |   101K (4) | 00:20:16 |       |       |

    |   8.         RANGE OF PARTITION ALL THE |                     |  2258K |    32 M |       |  2554 (2) | 00:00:31 |     1.   338.

    |   9.          FULL RESTRICTED INDEX SCAN FAST | PFA_NPCOFACTMES_103 |  2258K |    32 M |       |  2554 (2) | 00:00:31 |     1.   338.

    | * 10 |         INDEX UNIQUE SCAN | PK_AUX_CTAFACTU |     1.    13.       |     2 (0) | 00:00:01 |       |       |

    |  11.        FULL RESTRICTED INDEX SCAN FAST | PFA_FUSIONFACC_I01 |  3923K |    78 M |       |  5358 (2) | 00:01:05 |       |       |

    |  12.    TABLE ACCESS BY ROWID USER | PFA_FUSIONFACC |     1.    50.       |     1 (0) | 00:00:01 |       |       |

    |  13.   TABLE ACCESS BY LOCAL INDEX ROWID | PFA_NPCOFACTMES |     1.    56.       |     2 (0) | 00:00:01 |     1.     1.

    |  14.    NESTED LOOPS |                     |     1.    69.       |    49 (0) | 00:00:01 |       |       |

    | * 15 |     INDEX SKIP SCAN | PK_AUX_CTAFACTU |     1.    13.       |    47 (0) | 00:00:01 |       |       |

    |  16.     RANGE OF PARTITION ITERATOR.                     |     1.       |       |     1 (0) | 00:00:01 |   KEY |   KEY |

    | * 17.      INDEX RANGE SCAN | PFA_NPCOFACTMES_103 |     1.       |       |     1 (0) | 00:00:01 |   KEY |   KEY |

    ----------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    5 - filter(ROWNUM<10000)

    6 - access("CTA".") CTA_FACTURAC "=" WAS ". ("' CTA_FACTURAC")

    10 - access("NPC".") COD_POSTAL "=" CTA ". "" COD_POSTAL "AND"NPC ". "" CTA_FACTURAC "=" CTA ". ("' CTA_FACTURAC")

    15 - access("CTA".") CTA_FACTURAC "(=:B1)"

    filter ("CTA". "CTA_FACTURAC"(=:B1) "

    17 - access("NPC".") COD_POSTAL "=" CTA ". "" COD_POSTAL "AND"NPC ". "CTA_FACTURAC"(=:B1) "

    filter ("NPC". "" CTA_FACTURAC "=" CTA ". ("' CTA_FACTURAC")

    And statistics

    ----------------------------------------------------------

    1 recursive calls

    13252 db block Gets

    200711795 compatible Gets

    407276 physical reads

    Redo 3550216 size

    837 bytes sent via SQL * Net to client

    1320 bytes received via SQL * Net from client

    3 SQL * Net back and forth to and from the client

    2 sorts (memory)

    0 sorts (disk)

    9999 rows processed

    Rollback Terminado.

    But the query used by the update is much less "gets":

    SQL > SELECT WAS. ROWID

    NPC PFA_NPCOFACTMES, CTA AUX_CTAFACTU, WAS PFA_FUSIONFACC

    2 where 3 DEC. CTA_FACTURAC = WAS. CTA_FACTURAC

    AND NPC.cod_postal = CTA.cod_postal

    4 5 AND NPC.cta_facturac = CTA.cta_facturac

    AND ROWNUM < 10000 6;

    9999 filas seleccionadas.

    Passed: 00:00:20.57

    Run plan

    ----------------------------------------------------------

    Hash value of plan: 20234272

    -----------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                | Lines | Bytes | TempSpc | Cost (% CPU). Time | Pstart. Pstop |

    -----------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                     |  9999 |   937K |       | 29298 (2) | 00:05:52 |       |       |

    |*  1 |  COUNT STOPKEY |                     |       |       |       |            |          |       |       |

    |*  2 |   HASH JOIN |                     |   774K |    70 M |    58 M | 29298 (2) | 00:05:52 |       |       |

    |   3.    RANGE OF PARTITION ALL THE |                     |  2258K |    32 M |       |  2554 (2) | 00:00:31 |     1.   338.

    |   4.     FULL RESTRICTED INDEX SCAN FAST | PFA_NPCOFACTMES_103 |  2258K |    32 M |       |  2554 (2) | 00:00:31 |     1.   338.

    |*  5 |    HASH JOIN |                     |  3906K |   175 M |   123 M | 12842 (2) | 00:02:35 |       |       |

    |   6.     FULL RESTRICTED INDEX SCAN FAST | PFA_FUSIONFACC_I01 |  3923K |    78 M |       |  5358 (2) | 00:01:05 |       |       |

    |   7.     FULL RESTRICTED INDEX SCAN FAST | PK_AUX_CTAFACTU |   147K |  1869K |       |  1120 (1) | 00:00:14 |       |       |

    -----------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(ROWNUM<10000)

    2 - access("NPC".") COD_POSTAL "=" CTA ". "" COD_POSTAL "AND"NPC ". "" CTA_FACTURAC "=" CTA ". ("' CTA_FACTURAC")

    5 - access("CTA".") CTA_FACTURAC "=" WAS ". ("' CTA_FACTURAC")

    And statistics

    ----------------------------------------------------------

    1 recursive calls

    0 db block Gets

    54736 compatible Gets

    53070 physical readings

    0 redo size

    304491 bytes sent via SQL * Net to client

    7814 bytes received via SQL * Net from client

    668 SQL * Net back and forth to and from the client

    0 sorts (memory)

    0 sorts (disk)

    9999 rows processed

    The "PFA_NPCOFACTMES_103" index is partitioned. I don't know if it's related to this issue:

    SQL > select table_name, uniqueness, separated from all_indexes where index-name = "PFA_NPCOFACTMES_103";

    TABLE_NAME UNIQUENES BY

    ------------------------------ --------- ---

    PFA_NPCOFACTMES NON-UNIQUE YES

    SQL > select TABLE_NAME, COLUMN_NAME, position_colonne from all_ind_columns where index-name = "PFA_NPCOFACTMES_103";

    TABLE_NAME COLUMN_NAME POSITION_COLONNE

    ------------------------------ ------------------------------ ---------------

    PFA_NPCOFACTMES CTA_FACTURAC 2

    PFA_NPCOFACTMES COD_POSTAL 1

    Why the update does not generate as much "becomes"?

    Thanks in advance,

    Jose Luis

    I don't know the reason why at first sight, but it is obvious that the inner nested loop was doing a lot of work (full index scan).

    My first thought was to rewrite the query in a merge statement.

    Perhaps leads to a more effective plan and so no need to delve deeper into the issues you have raised ;-)

    merge into FUS PFA_FUSIONFACC

    a_l'_aide_de)

    SELECT

    NPC. COD_FACTUcaRA AS COD_FACTURA

    NPC. TOT_BASEIMPO_E AS TOT_BASEIMPO

    NPC. TOT_IMPEMI AS TOT_IMPEMI

    OF NPC, CTA AUX_CTAFACTU PFA_NPCOFACTMES

    where

    NPC.cod_postal = CTA.cod_postal

    AND NPC.cta_facturac = CTA.cta_facturac

    ) cta

    (TBT. CTA_FACTURAC = WAS. CTA_FACTURAC)

    When matched then update

    Was SET. COD_FACTURA = cta. COD_FACTURA

    was. TOT_CARGO_DB = cta. TOT_BASEIMPO

    was. TOT_CARGO_FB) = cta. TOT_IMPEMI

    where ROWNUM<>

Maybe you are looking for