PL/SQL cursor the current of location update

I try to use a cursor to load a query with a join of multi and then use the location being updated each result, but his does not work. It runs extremely fast (in way too fast to actually do something) and when I select the field I expect is updated I can't find updates.

So it's something like this:

cursor my_cur is
Select A.ID as AID, B.ID as QUOTES
OF A, B, C
WHERE... complicated join on tables 3
Update;
Start
for r loop my_cur
update a fixed PROSTHESIS = OFFERS the location being my_cur;
end loop;
commit;
end;

No idea why it wouldn't work? I'm totally inexperienced with pl/sql, so I don't know I missed something trivial or completely wrong understood something!

Might it have to do with my "join complicated on the 3 tables?

Trant says:

And it works very well.

Oops, current rate. You cannot use the CURRENT OF clause with a cursor declared with a join * since internally, the CURRENT mechanism uses the virtual ROWID and there is no way to specify the ROWID of the table that relates to:

SQL> DECLARE
  2     v_sal NUMBER(8,2);
  3     CURSOR c1 IS SELECT sal FROM emp e,dept d where e.deptno = d.deptno FOR UPDATE;
  4  BEGIN
  5     OPEN c1;
  6     LOOP
  7        FETCH c1 INTO v_sal;
  8        UPDATE emp SET sal = sal * 1.02 WHERE CURRENT OF c1;
  9        EXIT WHEN c1%NOTFOUND;
 10     END LOOP;
 11  END;
 12  /
DECLARE
*
ERROR at line 1:
ORA-01410: invalid ROWID
ORA-06512: at line 8

SQL> 

If something does not match. In all cases, you must add A.ROWID to the cursor and use it in the update:

SQL> DECLARE
  2     v_sal NUMBER(8,2);
  3     v_rid rowid;
  4     CURSOR c1 IS SELECT sal,e.rowid FROM emp e,dept d where e.deptno = d.deptno FOR UPDATE;
  5  BEGIN
  6     OPEN c1;
  7     LOOP
  8        FETCH c1 INTO v_sal,v_rid;
  9        UPDATE emp SET sal = sal * 1.02 WHERE rowid = v_rid;
 10        EXIT WHEN c1%NOTFOUND;
 11     END LOOP;
 12  END;
 13  /

PL/SQL procedure successfully completed.

SQL> 

SY.

Tags: Database

Similar Questions

  • Get the current Position/location of the blackberry

    Hi all

    I am developing an app that tells you so to were you are in the world... the less minimalist. any ideas how to on this subject? I have searched for the API for useful method calls, have only seen class net.rim.blackberry.api.Maps.MapView. I don't think that's all that is needed.

    In particular, I want to at least get the latitude and longitude of the current position of the phone. This is the main task for now. What are my options and how can I do to solve this.

    Thanks in advance

    Dan

    http://www.BlackBerry.com/developers/docs/5.0.0api/javax/microedition/location/LocationProvider.html

    There is also a pdf developer for this topic, check

    http://docs.BlackBerry.com/en/developers/subcategories/?usertype=21&category=development+guides

    (maybe you should read them all!)

  • Satellite Pro A300-15 t does not restart on the current after BIOS update

    Hello

    There is something wrong with my Satellite Pro A300-15 t. I made an update of the BIOS of toshiba recently with the latest Web site and it installed successfully. But after the installation, I noticed that my laptop does not restart when it is connected to the power adapter. It restarts and works perfectly when its power on the battery.

    After restart or start-up the laptop (on battery), it will be well when the adapter is connected.

    But, when I reboot when the adapter is connected, after his stop, just power light turns on for a second or two and gets off automatically. And not even the laptop starts manually by pressing the power button (LCD is turned off when the power light comes on for 2 seconds) when the adapter remains connected.

    So what I do is to pull the plug on the adapter, then start the computer manually by pressing the power button and reconnect the plug of the adapter to the laptop starts. It works well this way. Rest everything works perfectly.

    And this problem started after the update of the BIOS. Now, I don't know how to remedy the situation I don't know if there was a bug in the last update of the bios.

    Details of the update from: http://gulf.computers.toshiba-europe.com/innovation/download_bios.jsp?service=AE

    30/07/08
    Update the BIOS
    This Bios update adds functionality to your system.
    Satellite Pro A300 Toshiba of 3, 60 - WIN

    So please help me to solve the problem.

    Thank you best regards &,.
    Manjit M.

    Hello

    Try to update the BIOS again
    In addition, access the BIOS settings and set the default parameters. Save it and try again.

    Good bye

  • Change the current backup location.

    My computer is doing the backup to copy disk (E :) which is a partition on my C: drive.  This partition was renamed to d: E: and the hard drive has been changed to E:.  Still, the external hard drive was F: drive.  FOW can this broblem be resolved?

    Select Start, Control Panel, backup and restore, modify the parameters (below and to the right of the calendar).

  • Current GPS location

    Hello

    To get the current GPS location, I tried with this code, but doesn't seem to work

     private void testGPSLocation(){
            Thread t = new Thread(new Runnable() {
    
                public void run() {
                    //GPS Location
                    try{
                        LocationProvider provider = LocationProvider.getInstance(null);
                        Location loc = provider.getLocation(180);
                        Coordinates self = loc.getQualifiedCoordinates();
                        if (self != null)
                        {
                            double longitude = self.getLongitude();
                            double latitude = self.getLatitude();
                            System.out.println("longitude "+ longitude);
                            System.out.println("latitude "+ latitude);
                        }
                    }catch(Exception ex){
                        ex.printStackTrace();
                        System.err.println(ex.toString());
                    }
                }
            });
    
            t.run();
       }
    

    I tried to run GPSDemo of the samples provided by BlackBerry... but still he always gives the Longitude/Latitude/Altitude values by '0 '. I am running on BlackBerry 9530/9630. Are there settings need to be changed?  There is a possibility to enter the name of the server and I put my PC (localhost)... but still the same address. Any help on this would be appreciated.

    Thank you

    -DESTREEZ

    Large.

    Please check the thread "resolved".

  • After running sql of the lot, it is disconnected

    Hi all

    I wrote a batch program to run a pl/sql procedure. But after running, it disconnects.

    But I want to continue in the same session

    echo exec tracer.trace_pck.start_('alter session set sql_trace=true') | sqlplus hr/hr
    

    Output:

    Press a key to activate tracing

    SQL * more: Production of liberation 11.2.0.2.0 Thu Oct 10 15:59:56 2013

    Copyright (c) 1982, 2010, Oracle.  All rights reserved.

    Connected to:

    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

    SQL >

    PL/SQL procedure successfully completed.

    SQL > disconnected from Oracle Database 11 g Express Edition Release 11.2.0.2.0.

    Production

    Trace enabled successfully. Press a key for entry you sql

    If you use a batch file, I assume you are using windows OS.

    Essentially, what you need to do is call a sql file in the batch file and then download the sql file to call all the other files.

    Batchfile test.bat file test.sql sql calls

    sqlplus /password @test.sql

    test. SQL calls test1.sql and test2.sql and stops

    @test1.sql;

    @test2.sql;

    "exit";

    test1. SQL displays the current sid and serial No. FRO our name and our session

    Select 'test1', sid, serial # in session $ v

    where audsid = userenv ('sessionid');

    test2. SQL displays the current sid and serial for our name and our session No.

    Select "test2", sid, serial # in session $ v

    where audsid = userenv ('sessionid');

    When you run this you get t output similar to the following: (your SID and serial will be different)

    ' TEST SID SERIAL #.

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

    771 97 Test1

    ' TEST SID SERIAL #.

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

    771 97 test2

    It shows two separate sql files have been called, but are always in the same session

  • FM12 - catalogue No indicating paragraph do not tag to the current location of the cursor

    I just took training Adobe FrameMaker 12 now, I'm on my own machine and the interface is slightly different. Most of the time this isn't a huge deal, but there is a simple feature that the version of class that I can't turn on my desk. In the class version, whenever I need to click on the text, it would be "BOLD" the current paragraph tag in the paragraph catalog. For example, if I clicked tagged body text, the word body would be "BOLD" in the paragraph catalog. If I have the paragraph designer upwards, I can see the tag change there, but not in the catalog. Is there a setting somewhere to make this happen? I looked through a bunch of options and display of the menus, but I don't see anything that looks like to the proper adjustment. Thank you.

    I discovered the problem. I just needed to upgrade to the latest version of FrameMaker (12.0.4.445)

  • On the current location of the clause

    Hi all

    What is the advantage that you get by using the current of clause in a slider case. I found no particular reason anywhere.
    Anyway it is explained how to make updates using the location under clause is that you can update and delete the current row in the cursor.
    But who is still done by the a normal cursor also.

    Thank you and best regards,
    Sri Ram.

    As Sybrand alluded, the WHERE CURRENT OF clause uses the ROWID to do the update. This should be the most effective path.

    Justin

  • Unable to determine the current location by this time El Capitan

    Hello.

    Recently, I have this problem with my Macbook pro. I turn on location services, as you can see...

    ... but my computer is unable to determine the current location in the date and time. Cards and find my mac are not also work more.

    Currently I have version 10.11.5 of El Capitan. It happened from one day to another, I don't update the software or anything like that.

    Thank you

    Edgar Lopes

    Turn on Wi - Fi for the information about the location.

  • Thanks for the update of Firefox 4. Here is my concern - previously, the option "Search for updates" is located under the Help menu. In Firefox 4, I can't find this option; How will we be able to check if there are updates available?

    Previously, the "Find updates" option is located under the Help menu. In Firefox 4, I can't find this option; How will we be able to check if there are updates available?

    Can this new version to update automatically? How to set this option?

    Click the Firefox button, click Help, click on Firefox, there is a control for the button updates on this screen.

    Other issues that need your attention

    The information provided with your question indicates you have outdated plugins with known security and stability issues that need to be updated. To see the plugins submitted with your question, click on "+ system details...". "to the right of your original message of the question. You can also see your plugins in the Firefox menu Tools > Modules > Plugins.

    • Adobe Shockwave for Director Netscape plug-in, version 11.5

      • Several security updates behind
    • Adobe PDF plugin for Firefox and Netscape
      • Seems to be an older version
    • Shockwave Flash 10.2 r152
      • 10.2 r153 recently released security update
    • Next-generation Java plug-in for the Mozilla browsers 1.6.0_15
      • 9 updates behind
    1. Check your plugin versions on one of the following links:

    2. Update to Shockwave for Director
      • NOTE: this is not the same thing as Shockwave Flash; This installs the Shockwave Player.
      • Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place, so you can find it).
      • When the download is complete, exit Firefox (file > exit)
      • Locate and double-click it in the installer that you just downloaded, let the complete installation.
      • Restart Firefox, and look at your plugins.
      • Download link and more information: http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    3. Update of Adobe Reader (PDF plugin):
      • Within your existing Adobe (If you have already installed) drive:

    • Open the Adobe Reader program in your list of programs
    • Click Help > check for updates
    • Follow the instructions to update
    • If this method works for you, go to the section "download full installer ' below and go to"after the installation"below
  • Download the full installer (If you have NOT installed Adobe Reader):
    • "Use the links below in order to avoid the painful' getplus" Adobe Download Manager and other 'extras' you do not want
    • Use Firefox to download and SAVE the installer to your hard drive for the appropriate link below
    • Click "save to file"; Save to your desktop (so you can find it)
    • Once the download is complete, close Firefox
    • Click on the installation program, you just downloaded and allow installation to continue
      • Note: Vista and Win7 users need to right click on the installer and choose "Run as Administrator"
    • Download link: ftp://ftp.adobe.com/pub/adobe/reader/
      • Choose your operating system
      • Choose the latest version of # .x (example 9.x for version 9)
      • Choose the version the most recent number
        • NOTE: 10.x is the new Adobe Reader X (Windows and Mac only from this announcement)
      • Choose your language
      • Download the file, save it to your hard drive, when finished, close Firefox, click on the installation program you just downloaded and let it install.
      • Windows: click on the .exe file. Mac: click on the .dmg file
  • Using one of the links below will force you to install the "getPlus" Adobe Download Manager
  • . Also don't forget to uncheck the McAfee scanner if you do not want the link force installed on your desktop computer
  • After installation, launch Firefox and recheck your version.
  • Update the Flash plugin to the latest version.
    • Download and SAVE to your desktop, so you can find the Setup program later
    • If you do not have the current version, click on the "Player Download Center" link on the 'download and information' or 'Download manual installers' below
    • Once the download is complete, exit Firefox
    • Click on the installer, you just download and install
      • Windows 7 and Vista: will need to right click on the installer and choose 'run as administrator '.
    • Launch Firefox and recheck your version or up to the download link below to test the installation
    • Download and information: http://www.adobe.com/software/flash/about/
      • Use Firefox to go to the site above to update the Firefox plugin (will also install the plugin for most other browsers, except IE)
      • Use IE to go to the site above to update the ActiveX to IE
    • Download manual installers.
  • Update the Java plugin to the latest version.

  • See also "Manual Update" in this article for update from the Java Control Panel in Control Panel: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
  • Removal of older versions (if required): http://www.java.com/en/download/faq/remove_olderversions.xml
  • Remove several extensions of Console Java (if necessary): _ http://kb.mozillazine.org/Firefox: _FAQs_:_Install_Java #Multiple_Java_Console_extensions
  • Java test: http://www.java.com/en/download/help/testvm.xml
  • Unable to set the current location of the recovery image - "the recovery image cannot be written - error Code: 0x80004005.

    Original title Windows 8 error

    I'm trying to set the current location of the recovery image that I created with this command: "recimg /setcurrent C:\RefreshImage", but I get this error:
    "The recovery image cannot be written.
    "Error code: 0x80004005.

    I'm not trying to create an image, because I already have. I had backed up and copied to an external drive. My current drive became unbootable plu and had to rebuild and now want to set the location of the recovery image, I get this message on multiple computers.

    Hey guys

    don't know if your problem persists

    I solved my problem

    My recimg has win8.1 and my current OS is win8

    I've updated to win 8.1 and then set in the former could earn 8.1 recimg

    Salute the master

    PS. hope this works

  • How can I get a new PDF I save by default at the current location of PDF in Acrobat XI

    When I open a PDF file, make changes, and then save, it is by default the last folder where I saved a PDF file.  How can I do it by default in the folder where I opened the current PDF, I work on?  Acrobat 11.0.0 in Win 7 64.

    Thank you

    Dave

    This is not what my question was going, it's the default location which is screwed, but I realized that the problem has been fixed in an update and update of my version of the Acrobat Enterprise is not (go figure, they are paid only to provide this 30 + employees!)  I will mark this as done.

  • Flex TextInput to get the current position of the cursor

    TextInput component in how to get the current position of the cursor? Because I want to record a loss of focus on the location of TextInput dynamically add text.

    Here:RichEditableText is a part of the skin of the class spark TextInput and is what is doing all the text in the editing/rendering of work. If you need to make all text advanced operations, they need to go through the property here. Because it is a part of the skin, you need to make sure that is not null before doing anything on this subject.

    Fixed typo: it is the property here is, not textInput

  • Insertion of text box at the current location of the caret

    I'm trying to understand the best way to insert 'text' in a textarea at the current position of the cursor. Someone at - it advice for where to find it? In Flash, you used to get CaretIndex,

    Im trying to write a component of the code editor, so first of all Im capture the key event of the TAB and then going to insert a tab CHARACTER in the text box... At this time I was doing just that. Editor.Text is this. Editor.Text + ' '; But it is a stupid stupid idea - so instead of add at the end, I need to insert it into the current cursor position.

    Advice would be greatly appreciated. Once I did, I release it under the GPL or Apache license.


    Update: I found
    var: string text = this. Editor.Text;
    This. Editor.text = text.substr (0, this.) Editor.selectionEndIndex) + "" + text.substr (this. Editor.selectionEndIndex);
    This. Editor.setSelection (this.) Editor.selectionBeginIndex + 1, this. Editor.selectionBeginIndex + 1);

  • Impossible to update to the current version of the software

    My iPad would not be updated wireless, so I tried to do it via iTunes (I have the current version). However, when I connected to iTunes, the summary indicates that my iPad is updated with IOS 9.3.5 (even when I choose Control upgrade).  Suggestions as to how I can update?  No harm in updating my iPhone.

    An iPad 2 can't be updated past 9.3.5. iOS 10 requires at least a processor A6.

    (145048)

Maybe you are looking for

  • Don't remember the passwords of Facebook

    I'm rusty and did not share all of the media since eternity and a day. I forgot my password to share a video. How to get a Facebook information these username and password?

  • The upgrade on Pavilion 9667ea hard drive to SSD

    I think the upgrade my computer laptop 9667ea Pavilion by replacing the first hard drive of 160 GB with an SSD, as the Cruicial M500 240 GB SATA 111, or similar. Could you tell me if there are problems in doing this, because I see no other posted mes

  • My screen background color has changed and it is difficult to see things clearly in Windows Explorer.

    screen background color My screen background color took a deep blue tint which is whenever I visit a Web site, or windows Explorer. Therefore, it is difficult to see clearly. All solutions?

  • Removal of the air streams

    I just tried to delete a project relaese in the portal, and I couldn't find an option. I can select the output and submit it for approval, but not delete it. I guess I'm missing something blinding here, but how can I delete a project?:

  • Cannot install on VMware vSphere 1.1.1 ISE 5

    Dear friends, I try to install VM 1.1.1 on my vSphere environment ISE 5, but I get without success.  I met the required hardware configuration (2 CPUs, 4 GB of RAM, 100 GB drive and 1 NETWORK card), but I'm still stuck on the print screen attached (t