Need help on the essential "UPDATE" of the data in the table...

Dear experts,

Need Advice...

I have one table in which i have 200,000 records, now in this table for each record i have to update quantity figures...

To perform such bulk update i am using the following method...

*1. At first i create TYPE*

     CREATE OR REPLACE TYPE T_OBJ_GET_QTY (--);

*2. Create TYPE as table of object created in step 1*
 
     CREATE OR REPLACE TYPE T_GET_TEST_QTY 
     AS TABLE OF T_OBJ_GET_QTY; 

*3. assign object type to the variable*

     p_get_test_qty T_GET_TEST_QTY; (Created in step 2).

*4. now i write the cursor using type created in step 1...*

      cursor c_upd_qty as
       select T_OBJ_GET_QTY( col1, col2)
       from v_view;

*5. open cursor and fetch into variable created in step 3...*
      
       open c_upd_qty;
       loop
           fetch bulk collect into  p_get_test_qty limit 1000;
           --perfom update now..
             forall rec_upd_qty in 1..p_get_test_qty.count
                 update table t1 
                 set c1 = treat(p_get_test_qty(rec_upd_qty) as T_OBJ_GET_QTY).c1

                exit when notfound;
    end loop;
    close c1;


Kindly let me if this correct way to perform bulk update of the data, or is there any better way to do so...
Please share your inputs...

I hope i am clear in asking my question

Regards
nic
Published by: W Nicloei on May 27, 2011 01:10

Published by: W Nicloei on May 27, 2011 01:36

Published by: W Nicloei on May 27, 2011 01:45

Ahh, ok.

And a row of the view corresponds to a line in the table that you want to update?
I guess that your update statement would have a WHERE clause identifies the row to be updated, right?

If so, why not "merge" the view in the table, using the MERGE Oracle statement?

Something like:

MERGE
     INTO  target_table tgt
     USING source_view vw
     ON  ( vw.key-column(s) = tgt.key-column(s) )
  WHEN MATCHED
  THEN
     UPDATE
     SET   tgt.c1 = vw.c1
/

I still don't see why you would need a pl/sql program that retrieves all rows from the database in memory program and then writes all back in the database.

Tags: Database

Similar Questions

  • Speed/performance of my mac mini (mid-2010) is very slow. Need help, consolidate the files, software updates, etc. in order to improve the speed and performance.

    My mac mini (mid-2010) speed/performance is very slow - think of it as a result of letting my kids do "whatever" about it in recent years.  Need help, consolidate the files, software updates, etc. in order to improve the speed and performance.  You will also need to get data out of old PowerBook G4.

    < object edited by host >

    We are users like you.  Search locally by using something like Yelp or similar

    http://www.Yelp.com/search?find_desc=Apple+repair & find_loc = Chicago, + IT & start = 0 & ortby = rating s

    or read a few links which may be relevant on this forum about the slow mac mini

    http://BFY.tw/5C63

  • Need help with the error in windows update 80244019 is urgent please

    Please I need help urgent problem error update.

    I have a Dell Inspiron 1564, running Service Pack 1 of Windows 7.   I tried several times to update windows and nothing, just appears this error: Code 80244019, tried to install the Windows update agent and pops up the same error., NetFxRepair tool and nothing, FixDotNet, and nothing.  Did a recovery to the fabric (by default) and nothing.   About 2 years ago, I disabled the update and about 2 months ago I tried to update and I forgot the error. Now I need to reinstall all my programs, in the hope that with a recovery, it will fix the error and thrust my laptop, but now is worse, because the installation of updated doesn´t work, Corel Draw X 4 doesn´t supposed error of .NET Framework, so I tried the fixdotnet and netfx repair tool, but nothing. I need to work and I have can´t I have only a portable empty with an outdated windows. Help, please!

    Windows Update error 80070643
    http://Windows.Microsoft.com/en-us/Windows7/Windows-Update-error-80070643

    or

    Cannot install updates in Windows...
    http://support.Microsoft.com/kb/2509997

  • need help to trigger to update the change of columns of a table

    Hi all
    I need help in the manufacture of change update trigger in the columns from one table to another table.
    For example, table (col1 col 2 col 3 col 4 col 5 samplea
    .. .Col 20

    Now if I do any change in one of the data column must be changed to
    sample_copya... table that contains duplicate column

    So for this I thought to create a trigger with the following logic



    If updating (col1) then
    Update sample_copya set col1: =: new.col1 where n ° 1 =: new.no1;
    Otherwise, if the update (col2) then
    Update sample_copya set col2: =: new.col2 where n ° 1 =: new.no1;
    Otherwise, if the update (col3) then
    Update sample_copya set col3: =: new.col3 where n ° 1 =: new.no1;

    end if;
    But how doi handle if all columns are changed or say 2 columns record the number of columns is more than 20...
    I would like to know if there is a simpler method to achieve...
    Thank you

    susf wrote:
    Hi all
    I need help in the manufacture of change update trigger in the columns from one table to another table.
    For example, table (col1 col 2 col 3 col 4 col 5 samplea
    .. .Col 20

    Now if I do any change in one of the data column must be changed to
    sample_copya... table that contains duplicate column

    So for this I thought to create a trigger with the following logic

    If updating (col1) then
    Update sample_copya set col1: =: new.col1 where n ° 1 =: new.no1;
    Otherwise, if the update (col2) then
    Update sample_copya set col2: =: new.col2 where n ° 1 =: new.no1;
    Otherwise, if the update (col3) then
    Update sample_copya set col3: =: new.col3 where n ° 1 =: new.no1;

    end if;
    But how doi handle if all columns are changed or say 2 columns record the number of columns is more than 20...
    I would like to know if there is a simpler method to achieve...
    Thank you

    What is the purpose of this trigger?
    How can you be sure that ' where n ° 1 =: new.no1 "is true?
    How does line in the SAMPLE_COPYA table at the start?
    only the last modified value will lie in SAMPLE_COPYA than the previous values is written more

  • I need help with the program of Photos on my macbook pro

    I use a Macbook Pro with OS of Yosemite. I really need help with the Photo program. I never really got the hang of IPhoto and now that it's a new program, I'm really confused. Where can I go to learn this without waiting for the next workshop in a local store?

    Hi, I'm fighting to open same mine, making a new software update

  • im a student at the Academy of art and my creative cloud only let's tracks me because I never offer or give a serial number need help with the application

    I need help for the account and the sotfware please help

    I'll get an update this topic & you update tomorrow.

    Concerning

    Baudier

  • Need help with the installation of an adapter of Palit GeForce 9500GT Super chart - 512 MB in a M2N68 (narrated

    Need help with the installation of an adapter of graphics Super Palit GeForce 9500GT - 512 MB - DDR2 SDRAM in a M2N68 motherboard (narra6). Should I disable the onboard graphics in the bios? When the card is installed, no VGA work outs and the PC does not start. Checked and recontroler implementation of the card in the PCI slot. PC is a desktop HP G5200uk PC. Windows 7 operating system.

    Hello

    The link below is a guige to install a video card in your Pc.  In particular, it seems that you will have to perhaps specify the location of the new card in the bios and save this change before you install the new card - see step 4 in the guide on the link below.  If your new card fits into the PCI Express x 16 slot, you will need to define PCI Express in the bios and save the changes.

    http://support.HP.com/us-en/document/c01700855

    Kind regards

    DP - K

  • Satellite Pro A300-15V, I need help in the Organization of my startup list

    Hello everyone!

    I need help in the Organization of my startup list:

    (Why should Toshiba button support I this program if my laptop doesn't have multimedia keys? OR maybe this program for something else?)
    ItSecMng (although I have disabled the Bluetooth Manager to run when starting from this point still remains in the startup)
    Agent of filtering of Audio Conexant high definition (what is this program? Do I really need to start?)
    TOSHIBA Power Saver
    Toshiba Flash Cards
    RAID event monitor

    So, my friends. Could you give a valuable suggestion whether or not it is prudent to disable startup above entries? I want to speed up my laptop at the highest possible level.

    Thanks a lot for your time!

    Kind regards
    Osman.

    My laptop:

    Toshiba Satellite Pro A300-15V (PSAJ5E) => NOT have multimedia keys except the FN keys.

    > Toshiba Button support (why should I this program if my laptop doesn't have multimedia keys? OR maybe this program for something else?)
    You can disable it. If your mobile phone does not support the multimedia buttons then this tool is useless.

    > ItSecMng (although I have disabled the Bluetooth Manager to run when starting from this point still remains in the startup)
    I don't know what would make this process, but you can disable this in msconfig-> tab start Mr. If it would take in the future, then you could turn it on again.

    > Agent of filtering the Conexant high definition Audio (what is this program? Do I really need to start?)
    I think that this is necessary. It could improve your audio

    > Toshiba Power Saver
    This is important. It s an additional saving of Toshiba option for Win 7

    > Toshiba Flash Cards
    This tool controls the FN keys.

    > RAID Event Monitor
    Hmm so you don t have two hard disks, then you can try to disable it too.

  • I need help to the new photo of my photos from iphoto on El Capitan. Any help would be appreciated.

    I need help to the new photo of my photos from iphoto on El Capitan. Any help would be appreciated.

    To migrate your iPhoto library to Photos for Mac, drag it in the Photos icon in the Dock.  Photos will read the iPhoto library and create a new library of pictures of him.

    Is your photo library in iPhoto on an external drive? The migration will work that if the external hard drive Mac OS extended (journaled) file system.  If the library is on a disk with a different file system, Ministry of the environment of the library of a correctly formatted disk.

  • Need help with the button mute on my helmet XL-3000 of Microsoft Chat, please!

    Hi all!  Hope everyone is having a good TGIF!  If you use my helmet even, I need help understanding the region button mute in the middle of the rope.  The red light is on or off?  I suppose that if I hit the curve button with the microphone on this subject, and the red light, I'm turn off my mike?

    I did some tests with others on the phone calls.  Sometimes, some other hear me, sometimes they do not have.  BUT I NEVER HEAR THEM!  FOR MY WORK, IT IS IMPERATIVE THAT I MAKE CALLS TO OTHERS!  HELP PLZ!  Thank you very much and have a great wkend!

    Hello
     
    Please follow the links below to troubleshoot the computer.
     
    Method 1
     
    Connect one microphone, music player or other audio device to your computer

    Method 2

    Step 1

    Troubleshooting: headsets

    Step 2

    Open the troubleshooting of Audio recording

    Method 3

    How to adjust the microphone volume

    a. click Start, type mmsys.cpl in the search box and press ENTER.
    b.
    in the sound dialog box, click the recording tab.
    c. click Microphone, and then click Properties.
    Note Make sure that the work appears under Microphone. If the job does not appear, click Microphone, and then click on set as default.
    d. the Microphone Properties dialog box, click the custom tab.
    e. select or clear the box amp Microphone.
    f. click the levels tab.
    g. set the volume to the desired level, and then click OK.
    h. click OK to close the sound dialog box.
     
    How to adjust the setting of the voice
     
    a. start the game.
    b. connect to LIVE (the Guide).
    c. click personal settings.
    d. click on voice.
    e. make sure that the recording volume level indicator records at a bar when you talk.
    f. click done.

    If you are still facing problems then, I would say that you contact support for Microsoft hardware for more direct intervention.


    I hope this helps.

     
  • Need help with the launching track pack for forza code 4

    Bought new Forza 4 and the lancer Track Pack code does not work, how do I get a code that is generated in the form I've already paid for it. Rank of loads of numbers and sent 10 s of emails but cant seem to get help.

    This is the help I get when the cat to an Ambassador xbox on xbox.com

    Terry wrote:
    Need help with the launching track pack for forza code 4
    The Xbox Ambassador says:
    Location of Ambassador of the community...
    The Xbox Ambassador says:
    Location of Ambassador of the community...
    The Xbox Ambassador says:
    Your question will be answered by an Ambassador of the Xbox. You have been connected to the Ambassador as a user Xbox [3]
    The Xbox Ambassador says:
    Hello
    Terry wrote:
    Hello
    The Xbox Ambassador says:
    Hey
    Terry wrote:
    just to be on the phone to xbox live support and was told to come here
    The Xbox Ambassador says:
    ok\
    The Xbox Ambassador says:
    What is your problem?
    Terry wrote:
    I bought the 4 for forza ansd 360 new sealed Christmas...
    Terry wrote:
    has got 2 codes that accompanies the game but the pack track code does not work
    The Xbox Ambassador says:
    Wow good
    Terry wrote:
    whenever I put in the code it says code redeemed
    The Xbox Ambassador says:
    I think the code is used. You must return to the retailer
    Terry wrote:
    I tried to, but since I already opened the case they will not accept
    The Xbox Ambassador says:
    Oh. No,
    Terry wrote:
    the code had been used or defective as I am the only person who has touched the game once opened, tried to enter the code when it is open
    The Xbox Ambassador says:
    Maybe it was auto bought?
    Terry wrote:
    so, how do I get another code generated track Pack if defective?
    The Xbox Ambassador says:
    I do not know.
    Terry wrote:
    bought the game new, so I get the track pack
    The Xbox Ambassador says:
    Oh. It's bad.
    The Xbox Ambassador says:
    I think that if you Exchange 1 code it will buy it
    Terry wrote:
    car pack code worked, starter pack did not work
    The Xbox Ambassador says:
    Oh.
    The Xbox Ambassador says:
    It's a bad
    The Xbox Ambassador says:
    BTW you have an evolution of the tests?
    Terry wrote:
    Yes, I want to? but more anxious to get a code object generated for this pack
    The Xbox Ambassador says:
    Hey if I help can u give me this game too?
    Terry wrote:
    ?????????????????
    Terry wrote:
    So is it possible to get a code for that time?
    The Xbox Ambassador says:
    Hey
    The Xbox Ambassador says:
    Yes.
    The Xbox Ambassador says:
    you need to contact them
    The Xbox Ambassador says:
    and tell them that the code is used.
    Terry wrote:
    I was told to come here? where can I go to get the code?

    Hi Terryg76,

    ·         What version of the operating system is installed on the computer?

    I suggest you to contact the game manufacturer for more help and information.

  • I need help for the upgrade of my current system.

    I need help for the upgrade of my current system.

    I have SBS 2008 with (Exch 2007, SQL 2005, Sharepoint, backupexec 2010 for sbs) licenses.

    I want to make the larger environment using the following:

    (1) apply Virtualization

    (2) apply to the failover process (clustering)

    "(3) the environment must support adding server terminal server, ERP server, exchange server, domain controller, backup manager.

    Storage 4) that supports Raid (1 and 5)

    UTM excellent 6) that supports (SSL VPN, VPN Global)

    suitable backup solution 7)

    (8) good antivirus for clients

    my questions:

    (1) can you provide me with a good design for this environment

    (2) should I choose what operating system:

    Microsoft datacenter or company

    I know datacenter provide us the unlimited VM but needs per processor license

    so if I have two Grouped servers I want to buy 4 licenses

    and just 4 VMs per company license... to say that we have two servers and maintain 8 vms so wat happened if 1 goes down... How can I migrate the 4 virtual machines on the server failed to another server group... ? should I buy enterprise license?

    (3) if I get the SAN storage for data... How can I save this storage... should I get another SAN?

    (4) how can I upgrade SBS stad single server (windows standrad) without losing the licenses as Exch 2007, SQL 2005, sharepoint.is it a must to buy an edition full std server or there is a way to upgrade (license wise, I mean)?

    (5) what about win2k8 license for VM:

    lets say we have physical that has windows license so that enough to have windows for VM or should I buy windows for VM licenses?

    (6) can I use backExec license for SBS with windows 2008 standard

    (7) who better to virtualization AMD or INTEL

    (8) hyper V or VMware?

    (9) what of Microsoft data protection Manager... is this good?

    (10) what virtual machine manager? What are the benefites keys

    Thanks in advance

    Hello AnasAI,

    You can find the Server forums on TechNet support, please create a new post at the following link:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • Need help with the blue screen issue "NAVEXI5. SYS, PAGE_FAULT_IN_NONPAGED_AREA ".

    Original title: need help with the blue screen issue
    My computer turns saying a blue screen: a problem has been detected and windows were shut down to prevent damage. The problem seems to be caused by the following file: NAVEXI5. SYS PAGE_FAULT_IN_NONPAGED_AREA he seems to have a different error whenever he turns to a blue screen. Can someone help me please.

    Hello

    1. Since when are you facing this problem?
    2. you remember to make changes to the system?
    3. do you get an error with this error code?

    I suggest to unplug external devices such as printer, scanner, etc. that are plugged into the system, and then restart the system and check if the problem persists.

    Method 1.
    I suggest you to do a check disk from the recovery console and check if the problem is resolved. Follow the steps mentioned below.
    a. start into the recovery console using the XP CD. Follow the steps mentioned in the article below.
    Description of the Windows XP Recovery Console for advanced users
    http://support.Microsoft.com/kb/314058
    b. perform a disk check.
    How to perform disk error checking in Windows XP
    http://support.Microsoft.com/kb/315265

    Method 2.
    I suggest you to start with the XP CD and then do a system restore. Follow the steps mentioned in the article below.
    How do I recover from a corrupted registry that prevents Windows XP startup
    http://support.Microsoft.com/kb/307545

    I hope this helps.

  • need help with the backup of the copy of the OS

    Hi team,

    I bought the new Presario CQ40 and I need help regarding the opertaing and activation office 2007 system backup, please respond as soon as POSSIBLE.

    Thank you and best regards,

    Nancy (Julien).

    Are you needing information to create the recovery disk set? HERE

    As for activation Office 2007-if you paid for a license extend the 60-day trial version, simply enter your key when asked to activate. If you have not purchased a full license, you should be the link for the purchase of Ms. You can also buy Office 2007 locally(probably cheaper) and just use him license key to activate your preinstalled version.

  • I need help on the matrix of action script 3.0

    I need help on the matrix of action script 3.0

    [Ask in the correct forum allows... Left non-technical Forum Lounge for forum specific program... MOD]

    to apply a matrix for mc mat oppose:

    var mat: Matrix = new Matrix;

    mat.a = Whatever;

    mat.b =

    mat.c =

    mat.d =

    mast. TX =

    mat.Ty =

    MC. Transform.Matrix = Matt;

  • Need help with the IP configuration on vm ware for the installation of 11 GR 2 on linux vmware 6 on win7

    Need help with the ip configuration on/etc/hosts for the installation of 11 GR 2 on linux vmware 6 on win7.

    Let me know if you need more info... in fact I have a setting error while installation said

    -(/ etc/hosts has no correct entry for the host name)

    Host: 192.168.85.100

    Win7 ip: 192.168.1.x

    Thank you...

    (host computer)

    Win7 64 bit

    (vmware)

    Oracle Linux Server 6.3 version

    Release of Red Hat Enterprise Linux Server 6.3 (Santiago)

    Oracle Linux Server 6.3 version

    -(/ etc/hosts has no correct entry for the host name)

    Then post your/etc/hosts.

    Host: 192.168.85.100

    Win7 ip: 192.168.1.x

    Why 85? have you tried 192.168.1.100?

Maybe you are looking for