CURRENT OF refuses to use my cursor - why?

On Oracle 11.2
create or replace
procedure example
is
row TABLE1%ROWTYPE;
c1 sys_refcursor;
BEGIN
     open c1 for
          SELECT * from TABLE1 where foo = 1 order by prim_key FOR UPDATE SKIP LOCKED;

     LOOP FETCH c1 INTO row;
          EXIT WHEN c1%NOTFOUND;
               UPDATE TABLE1 SET
                    bar = 2
               WHERE CURRENT OF c1;
     END LOOP;
     CLOSE c1;
END;
/
Gives this error:
LINE/COL ERROR
-------- -----------------------------------------------------------------
11/4     PL/SQL: SQL Statement ignored
13/21    PL/SQL: ORA-00904: : invalid identifier
13/21    PLS-00413: identifier in CURRENT OF clause is not a cursor name
What's wrong? I guess it's something minor that I neglected.

Kind regards
David

xerces8 wrote:

If I use a slider like this explicit:
Is it in terms of the order of execution as if with a

Yes, and I see no reason to use ref cursor.

SY.

Tags: Database

Similar Questions

  • Why we use the cursor

    Hi all

    I would be grateful someone right me if I'm wrong. I ask the question below just for my purpose of learning.

    Question - Why do we use the cursor?

    Response Cursor is used to treat several lines in PL/SQL.

    Or

    Is used to treat a set of records from one or more tables, you can write a cursor on the table using select statement and then you can browse through all these a Recordset, and perform your required operations.

    Post edited by: Muzz, I'll open another discussion to my other question. Thank you

    Hello

    Muzz says:

    Hi all

    I would be grateful someone right me if I'm wrong. I ask the question below just for my purpose of learning.

    Question - When we use Procedure and Function when?

    Response

    When you want to run a series of DML statements then do like us and when we want to return a single value, then we use the function.

    Much has been written on this subject.  Start by finding some of them:

    https://www.Google.com/#q=when+use+procedure+function+Oracle

    read some of them and then ask a more specific question

    Procedures are not just for the DML; There are a lot of things in addition to DML you can do in the procedures.  For example, you can send e-mail messages, or can read and write files.

    The second half of your response, 'when we want to return a single value, then we use the function', is the right of bascally.  In particular, when you want to return a value that will be used in a SQL statement, you use a function.

    Functions in the pipeline are a special case.  A lot of what you read or you say about 'functions' means implicitly 'no Pipeline functions.

    Question - Why do we use the cursor?

    Response Cursor is used to treat several lines in PL/SQL.

    Or

    Is used to treat a set of records from one or more tables, you can write a cursor on the table using select statement and then you can browse through all these a Recordset, and perform your required operations.

    You'll have best results if you start a separate thread for each separate issue.  This issue is completely separate from the question on procedures

    You're right that the sliders are a way to process the rowsets, which can contain 1 line or several lines.

    Yes, you can use a slider to manage the rows one at a time.  Do not forget that it will be less effective than the manipulation of all at once, so don't use a cursor to do something that can be done in a single SQL statement.

  • on paint it willnt allow to use the text why

    on paint it willnt allow to use the text why

    Hi logannill,

    What version of windows are you using?

    You can add text to pictures using paint, you can follow the steps below

    1. open MS Paint your current photo.

    2. find the area where you want to add text.

    3. Select the text tool, represented by the letter A, in the box to tools on your left.

    4. position the cursor on the location where you want the text to start.

    5. Select the font style and size of the help box that appears when you select the tool.

    6. start to type. You will see the text added during typing. It is a good indicator of how it will look when you are done.

    7. click outside of it, and it will be fixed on your photo. If the spacing, size or placement is not quite right, scrap it and start again by selecting 'Cancel' in the Edit menu, and then restart the process again

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Problems using trigger cursor query and post.

    Hello

    I use a block non-base of data/model to query records in a database block. My form has a point text 'report No.' that will be used to enter a valid number of reports. Based on the number of this report, I hit a button to search (also from the same block of data non-base) to view records that have this "report No.' in the database block. I think I need to use a cursor in a post for this request but I am not able to operate :( Help, please! I really need this point that nobody is helping me to work:(la figure)

    My search button - button the trigger:
    DECLARE
    NUMBER OF CHOICES;
    BEGIN
    IF: DUMMY_BLK. NWTFR IS NULL THEN
    ALERTS. STOP_ALERT ("Start Date is required", choice);
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    go_block ('T_VESSEL_BLK');
    execute_query;
    END;

    My post_query:

    DECLARE
    cursor vessel_cur is
    SELECT VES_RPTNO, VES_SENDER, VES_SENDER_MBOX, VES_INTCTRL_REF, VES_NAME, VES_VOYNO, VES_ARRDT
    SHIP
    WHERE VES_RPTNO =: DUMMY_BLK. NWTFR;
    var_mot vessel_cur % ROWTYPE;
    BEGIN
    Open vessel_cur;
    LOOP
    extract the vessel_cur in var_mot;
    EXIT WHEN vessel_cur % NOTFOUND;
    END LOOP;
    close vessel_cur;
    END;

    instead of execute_query you do now

    Why do you offer me something like that? Replacing the standard behavior that you use forms must be well thought out, because you have to manage a large number of possible problems. You can easily get the desired using the standard logic behavior:

    -Create an item number IT_COUNT in a control block, assign 'calculation mode' to 'Summary', 'Synthesis function' to 'Count' "Down block" and your DB-bloc and "just point' a null-element not contained in this block. Last series the block 'Interrogate all folders' to 'Yes' in your databaseblock. Now, in your code, you can just checkl the value of this element of count, as

    ...
    EXECUTE_QUERY;
    IF :BL_CONTROL.IT_COUNT=0 THEN
      error
    END IF;
    
  • where the requirements for the current download? This used to be posted prominently.

    where the requirements for the current download? This used to be posted prominently.

    See:

    You can find the full version of the latest version of Firefox 24.0 in all languages and for all systems operating here:

  • I'm using firefox 9, why can't I save as image on google image?

    I'm using firefox 9, why can't I save as image on google image?

    Try Firefox SafeMode to see how it works there.

    A way of solving problems, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open the Firefox 4, 5, 6, 7 SafeMode pressing the SHIFT key when you use the desktop Firefox or shortcut in the start menu.
    • Or use the Help menu option, click restart with the disabled... modules while Firefox is running.

    Do not choose anything at the moment, just use 'continue in safe mode.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before using the shortcut of Firefox (without the Shift key) to open it again.

    If it's good in Firefox Safe mode, your problem is probably caused by an extension, and you need to understand that one.

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

    When find you what is causing that, please let us know. It might help others who have this problem.

  • Using a cursor to refresh a linear ball screw in directions opposite

    Hello

    I have a screw linear ball run by a motor/controller configuration. I would use a cursor to essentially "shaking" the platform mounted on the screw forward or backward a certain distance. However, the controller has its own language to control the movement of the engine. For example, /1P10000R would move the engine sent 10000 steps in the positive direction and /1D10000R as a '1' would move the engine 10000 steps in the negative sense. My question is this: if I put the cursor in the range from-100 to 100 mm, how do I get the output to have a 'P' in the front for the numbers from 0 to 100 and a "D" frontfor numbers ranging from-100 to 0? I guess, basically, how the slider handle negatives? I have a vi to convert mm numbers to the steps.

    Thank you.

    Hi manchmal2,

    using string formatting functions?

  • I deleted the account current user which I use through, Mycomputer manage option, know that I am in this user only, please help me restore this user...

    I deleted the account current user which I use through, Mycomputer manage option, know that I am in this user only, please help me restore this user...

    Hello

    Who is the user account you have currently connected?

    Research of user in the sub folder location:

    Folder C:\Documents and settings\Users

    If you find in the folder the administrator account user, then you may need to create a new user account and transfer of records and documents to the new location

    See the link for the procedure below: how to copy data from a corrupted to a new profile in Windows XP user profile:http://support.microsoft.com/kb/811151

  • Sunday 15 May 2011 after trying to use Microsoft Update why I get the following error message? [Error number: 0 x 80070020]

    Sunday 15 May 2011 after trying to use Microsoft Update why I get the following error message? [Error number: 0 x 80070020]

    Hi MikeGoodold,

    1. did you of recent changes on the computer?

    2. do you have security software installed on the computer?

    See the below Microsoft article and try the steps mentioned, check if it helps.

    You receive error 0 x 80070020 when you use the Windows Update Web site or the Microsoft Update Web site to install the updates

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

  • I added my e-mail account current and most often used, but has any of my files from this account and any unwanted file.

    * Original title: e-mail files

    I just got my new computer with win10. I added my e-mail account current and most often used, but has any of my files from this account and any unwanted file. These files can be added?

    You cannot add folders to the Mail App. I suggest you to install an e-mail client. I use Thunderbird myself.

    Top 11 programs free email for Windows
    http://email.about.com/od/windowsemailclients/TP/free_email_prog.htm

  • are there any current HP printers that use the HP 02 print cartridges? Old printer C6180 goes wrong.

    are there any current HP printers that use the HP 02 print cartridges? Old Photosmart C6180 printer goes wrong and have a lot of cartridges.

    The Site of HP Pageyield lists the following printers compatible with 02 cartridges:

    I do not believe there are all the models currently available that use cartridge 02.

    I heard that HP has (had?) a trade-in program for its intact packaging expired cartridges.  See this post for a suggestion.

  • Current length of track using mm_renderer

    Hello

    IM writing my own MediaPlayer using the API of Client for the multimedia rendering engine. How can I implement a getDuration() method (which must returns the duration of the current track in seconds) using this API? Is it still possible? AFAIK the default MediaPlayer - bb/multimedia/MediaPlayer encapsulates the ROR, so there must be a way to achieve

    Thanks in advance

    Hello iksarp,

    You can make use of the mm-converter of event management new mechanism to achieve this. It is located in the header file: 'mm/renderer/events.h. ' You would have to wait for the events of mm-rendering engine and look in the Dictionary object that it returns for different events. Specifically, for the field "Duration", it is returned in milliseconds and I am pasting a few snippets below:

    
        // At first, set up everything for the mm-renderer context to run
        // The set up steps should be similar to the existing sample application (https://github.com/blackberry/NDK-Samples/blob/next/VideoPlayback/main.c) but WITHOUT THE BPS EVENT HANDLING for mm-renderer
        // That is, you DO NOT need to do handle BPS event handling if you do the following event handling with "mm/renderer/evenths.h"
    
        // Now, do the event handling
        int errorWait;
        const mmr_event_t* event;
    
        for (;;)  {
            errorWait = mmr_event_wait( mmr_context );
    
            if (errorWait != 0 ) {
                //TODO: Error handling
            }
            // now, get the actual event
            event = mmr_event_get( mmr_context);
    
            switch (event->type) {
            // TODO: Handle all other switch cases, for the event types
            case 6:
                //metadata
                printf("###### event->type = 6 = MMR_EVENT_METADATA\n");
    
                const char *duration = strm_dict_find_value( event->data, "md_title_duration");
                fprintf(stdout, "duration= %s\n", duration);
    
                break;
            } // switch
    
            fflush(stdout);
        } // for
    

    Essentially, for each event from mm-rendering engine, a set of attributes are exposed as elements of dictionary (in the 'data' field), to reflect the current state of the mm-engine rendering context (for example, read status, title, duration, etc.).

    What's new with Beta 3 and the documentation is still not published correctly. We apologize for this; I have raised this issue with the documentation teams and I'll try to get them to publish

    Hope this helps and please let us know if you need anything that anyone else.

    See you soon,.

    Rashid

  • My OS has been upgraded to Windows 7 at 10 without disabling the software Adobe Acrobat. I am currently not able to use the serial number. to validate the (Acrobat 9.0) software installed on the machine. How can I go on the validation of the software not

    My OS has been upgraded to Windows 7 at 10 without disabling the software Adobe Acrobat.

    I am currently not able to use the serial number. to validate the (Acrobat 9.0) software installed on the machine.

    How can I go on the validation of the software now?

    Try contacting the Adobe Support via chat and ask them to reset your activations - don't ask more than that or they are likerly tell you to look on the forums for help (where no one can help with reset).

    To the link below, click on the still need help? the option in the blue box below and choose the option to chat...
    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If it fails to connect, try to use another browser.

    Serial number and activation support (non - CC) chat
    https://helpx.Adobe.com/contact.html?step=PHSP-PHXS_downloading-installing-setting-up_lice nsing-activation_stillNeedHelp

  • I have the last El Captain MAC update fom and an iMac Mid 2015 retina but Lightroom refuses to use the GPU indicating a display error. Has anyone else experienced the same question?

    I have the latest update of El captain and an iMac Mid 2015 retina but Lightroom refuses to use the GPU indicating a display error. Has anyone else experienced the same question?

    I also got an iMac mid 2015 27 "retina and not have problems. But I have another option 'see the add screen pictures"deselected it's the ravages of a single reading. See screenshot of my graphics card.

  • I currently run a personal use license of Illustrator CS3 on windows XP on dell desktop and a computer dell laptop >

    I currently run a personal use license of Illustrator CS3 on windows XP on dell desk top and AComputer dell laptop > high Dragon died and the xp is on its last breath, I upgraded to na mini apple mac and one Apple top pro tour.  the two run the parallel software with windows 8.1 for any substance of windows ole I still need, I tried to install the illustrator software, but as I am still registered with older machines and the limit is 2 PCs, can't do the software to load.  We know how to unregister my existing machines for me to migrate software to my new machines.  Keep in mind on computer, portable said is completely dead

    Thank you

    with support of chat line, they disabled the existing records, directed me to a download site for CS 3 software I have loaded and was subsequently able to activate using the original serial number.

    Thank you

    JOHN

Maybe you are looking for

  • My HP 6500 AirPrint printer does not print after re plug AirPort Express

    After finding my Airport Express 802.11n flashing yellow I unplugged and then plugged back.  Green light came.  Then nothing would print to my HP Printer officejet 6500 has.  I said that it is connected. I have installed and reinstalled the printer,

  • where the daqmx on real-time target files are stored?

    Hello I'm working on an application that is embedded in a desktop RT target.  To make the system easier to maintain in the future, I would like to be able to generate a DAQmx task programmatically to the *.ini file exported from MAX.  In this way, us

  • Older graphics drivers 1 year on my computer is really up-to-date?

    I downloaded the latest graphics drivers from intel for the Intel HD Graphics 4400 on my Aspire V5 - 573P, but when I try to run setup.exe as an administrator, I get the message: "the pilot is not validated for this computer. You can get the specific

  • WS-C2960S-48FPD-L with high memory usage.

    I have in my network has a WS-C2960S-48FPD-L, which use more than 90% of the memory. The installed version of IOS is 150 - 2.SE2 (c2960s-universalk9 - mz.150 - 2.SE2.bin), could not know if it is a BUG. The treatment is about 23%. Here is the 'show p

  • Eclipse 3.4. -> 3.5: the localsresource type is already defined

    Hello I try to make changes to a project to maintain in Eclipse 3.4, now I moved to Eclipse 3.5 due to the OS 6 SDK. I'm having a problem with my text resources. I have a "type LocalsResource is already defined" when I compile Isaiah. It is the trans