Fetch and For in the Cursor

Hello everyone,
Will there be any difference if i use FETCH instead of FOR loop while accessing the cursor in PLSQL? I was unable to figure out the difference.
Thank You.
Kumr

I assume your question is about the difference of this code,
declare cursor c1 is ....
r1 c1%rowtype;
begin
     open c1;
     fetch c1 into r1;
     while c1%FOUND
     loop
         do stuff...
         fetch c1 into r1;
     end loop;
     close c1;
end;versus this code,
begin
     for r1 in (your cursor text here)
     loop
       do stuff...
     end loop;
end;
/Both code segments do the same. Obviously in the 2nd case you're writing less code.
And, if you are on 11G, then the 2nd code segment will perform better due to internal use of (bulk) array fetching that Oracle will do for you.

Similar Messages

  • My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words.

    My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words and looks them up via dictionary. I currently have a wireless mouse connected and I am still having the same problems.
    I fee like I may have a virus or my laptop is perhaps being accessed remotely. All of the sharing options are unchecked.
    HELP PLEASE
    Very worried!!

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
         after the chime press and hold down the OPTION key until the boot manager screen appears.
         Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).

  • Creating Planned orders and Requisitions for a particular MRP controller and for all the others only Requisition is to be created.

    Hi Experts,
    Currently we run Program 'RMMRP000' as a batch job to create Planned orders and requisitions.
    The client wants that Planned orders and Requisitions should be created for a particular MRP controller and for all the others only Requisition is to be created.
    I implemented Exit 'EXIT_SAPMM61X_001' in the following manner by passing MRP controller to user_key.
      IF mt61d-dispo <> user_key.
        no_planning = 'X'.
      ENDIF.
    But as you can see that this will not meet my client requirement.
    If any of you has worked on similar requirement / if any one knows that this is achievable or not,
    please share your inputs.

    Moved from SAP ERP Sales and Distribution (SAP SD) to ABAP Development
    G. Lakshmipathi

  • Hello, i have a macbook pro 15 inches, for the past 1 year. But since then i have been experiencing weird problems. firstly my battery does not last very long, my laptop heats up a lot and very fast,the cursor behaves oddly and the screen changes onitsown

    The screen changes on it's own, the cursor gets stuck on a word and gets me the meaning of it with a dictionary. if i am on google chrome, the screen would go back to the previous page i visited even without i do anything!  it also goes on the launchpad and desktop without me touching it! with no hands on the board. i am a student and i cant figure out the problem. i would really appreciate if anyone could help me on this asap!
    Thank you.

    If nothing else try a smc reset:
    http://support.apple.com/kb/HT3964

  • Need help for focusing the cursor from one textbox to another textbox

    hii all,
    I have a problem in java script.
    Note:The textboxes are generated dynamically.it is not having fixed length.(the number of textboxes generated may be 3,2,4....etc.it is not fixed.
    To move cursor from one textbox to another text box ,I have taken the length of the textboxes of the first column.I used onkeyDown event .
    in the function ,first i checked the condition like
    for(i=0;i<form1.box.length;i++) //box is the name of the textboxes
    if(event.keyCode==13)
    form1.box[i+1].focus();
    return false;
    by using this the cursor is moving from first text box to second textbox and stops.
    if i use event.returnValue=false; instead of return false ,then the cursor automatically going to the laxt textbox of the column.
    my problem is how i can focus the cursor from one textbox to another textbox one after the other till the end.
    if any one has solution please help me.
    also if we can do in another way also,please help me.
    thanx.>

    thanx .u helped me so much.
    i have to check another condition. see the code below
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    <SCRIPT language="Javascript">
    function fnTest(str) {
    if(event.keyCode==13) {
    if(str == 4) {
    formHeader.box[0].focus();
    else {
    formHeader.box[parseInt(str)+1].focus();
    return false;
    </SCRIPT>
    <BODY>
    <FORM name="formHeader">
    <CENTER>
    <INPUT TYPE="TEXT" name="box" value="" onKeyDown="javascript:fnTest('0');">
    <br>
    <INPUT TYPE="TEXT" name="box" value="" onKeyDown="javascript:fnTest('1');">
    <br>
    <INPUT TYPE="TEXT" name="box" value="0" disabled="false" onKeyDown="javascript:fnTest('2');">
    <br>
    <INPUT TYPE="TEXT" name="box" value="" onKeyDown="javascript:fnTest('3');">
    <br>
    <INPUT TYPE="TEXT" name="box" value="" onKeyDown="javascript:fnTest('4');">
    </CENTER>
    </FORM>
    </BODY>
    </HTML>
    suppose if some of the fields are disabled,then the focus must skip to the next one.i have written disabled for box2.if the cursor focuses in box1,then the cursor should move to box3 escaping box2.
    if u know plz tell me.

  • Firefox4 on ubuntu, after awhile when I click on bookmarks and then move the cursor down to a bookmark, the list of bookmarks disappears. A stop and start of firefox4 fixes the problem but what is the long term fix?

    I upgraded to 4 and I noticed that after 4 has been up for an hour or so I click on the bookmarks. I see my list of bookmarks below but when I move the cursor down to select one, the list disappears.
    The only way I have found to fix this is to stop and start 4. I can then move the cursor down to select a bookmark. This problem has not occurred in previous versions.
    ps.. no '''''delicious''''' installed

    No, I see the three areas at the bottom of the Bookmark area that you refer to, but that also highlights an issue.  When I want to save a story to my Reading List and click on Share then "Add to Reading List" then go back to look at what is stored in the Reading List, my recently-saved item is not there.
    I looked thru the History tab and the Reading List tab and have been in the Bookmark tab.  But even when I Save a Bookmark, that newly-saved Bookmark does not show up in the Bookmark area.
    But then again, the next day (and actually just in the last half-hour) all of the functionality came back.  When I look at the Bookmarks, suddenly, again, all of the Bookmarks that are on my Safari browser on my iMac are now there, and I can now Save a Bookmark.
    It keeps coming in and out and that is what is driving me a little nuts.
    Thanks.

  • Please answer once and for all the boot green screen

    I have searched everywhere for an answer since my issue.
    Relevant info:
    iPhone 3GS.
    iTunes version 10.7.0.21 (2012-09-12).
    Doesn't matter what system I have since this is related to an iPhone device.
    Fully charged battery before proceeding with the update.
    Updated the iOS 5.1.1 of the iPhone to iOS 6.0 through required update recommendation of iTunes.
    Never been abused, jailbroken, serviced or dropped. (never had issues until the update)
    Once completed the updated process of iTunes and iPhone was done with the internal installation, the iPhone rebooted with a green screen/hue and the apple logo was still original color "silver". It loaded up to the iPhone Configure screen still with green color screen/hue.
    I pressed on the power button for 5 seconds and slide "slide to power off" and the iPhone turned off. I waited about 15 seconds and pressed on the power button to turn the iPhone back on, hoping no more green screen/hue and the apple logo was still original color "silver" but returned to the original green screen/hue and the apple logo was still original color "silver".
    Failed!
    It still showed green screen/hue and the apple logo was still original color "silver" and booted to the iPhone Configure screen still with green color screen/hue.
    Remedies tried after searching the internet:
    Hard Restart/Reset.
    DFU Mode. (even tried a restore process with iTunes again *so much time wasted to obtain the iOS download again*
    Recovery Mode (even tried a restore process with iTunes again *so much time wasted to obtain the iOS download again*
    Recovery from Backup is denied because previous version was iOS 5.1.1 and iTunes refuses the process so (even tried a restore process with iTunes again *so much time wasted to obtain the iOS download again*
    Left the iPhone at the Configure screen until battery drained and then plugged it back into the USB port of system until it charged long enough for the iPhone to boot yet again green screen/hue and the apple logo was still original color "silver". It booted to the iPhone Configure screen which is still the green screen/hue and I left it charging until battery icon top right showed full.
    Now, can someone give a straight answer while staying on this topic about this issue, please?
    *I can understand if the apple logo was green then it could be a screen issue but it is not the case.
    All help is greatly appreciated even if you took the time to read all of this but did not answer.
    Thank you!

    halodev:
    I made a CF/Flex site based on the Flexstore sample app,
    using a database instead of XML as the data source; in case you
    want to see it:
    http://www.timos.com/dg/flex/DilemmaGames.html
    At first I had troubles similar to what you describe;
    initially, part of the problem was that my hosting company had not
    yet upgraded to CF 7.02. One other thing I had to correct: when you
    upload to your server, upload the entire ‘bin’ (or
    whatever your output folder is) minus the debug SWF.
    If it would help with other issues, contact me and I will be
    glad to make my project code available to you. Good luck.
    Carlos
    [email protected]

  • HT4930 How do I change the size and shape of the cursor so that it doesn't block viewing notes be hid it ?

    The standard mouse is fine EXCEPT when it hides the tips and tricks behind it. Is there a way to make the mouse more transparent or of a different shape for some applications ?

    System Preferences > Universal Access > Mouse

  • My computer is infected with something...the cursor is going crazy.  i bought apple to avoid infections and now you want to charge me to get rid of the malware? i paid for protection when i bought the computer. shame on Apple.

    my computer is infected with ?malware and it makes the cursor goes crazy. apple support wants to charge me to fix this.
    paid more for the apple laptop because it had built in protection. not fair.  shame on Apple.  can anyone help?

    Please read this whole message before doing anything. This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it. Step 1 The purpose of this step is to determine whether the problem is localized to your user account. Enable guest logins* and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up guest users” (without the quotes) in the search box. Don't use the Safari-only “Guest User” login created by “Find My Mac.” While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin. Test while logged in as Guest. Same problem(s)? After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it. *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing. Step 2 The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows: 
    Shut down your computer, wait 30 seconds, and then hold down the shift key while pressing the power button.
    When you see the gray Apple logo, release the shift key.
    If you are prompted to log in, type your password, and then hold down the shift key again as you click Log in.
     Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs. The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. *Note: If FileVault is enabled, or if a firmware password is set, you can’t boot in safe mode. Test while in safe mode. Same problem(s)? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Cursor tips : refresh data fetched by the cursor within run time,discussion

    Hello there,
    May be what I am asking about is kind of weird, but here is the Q:
    let us assume that I have cursor defined as follows:
    cursor emp_cursor is
            select EMPNO, ENAME, deptno
            from emp
            where deptno = 10 ;
    emp_rec  emp_cursor%rowtype;  then inside the loop through the data fetched by this cursor, I need to update some records, which might match the criteria of the cursor, by trying the following code segment:
    open emp_cursor;
          loop
            fetch emp_cursor into emp_rec;
            exit when emp_cursor%notfound;
            "PROCESS THE RECORD'S DATA "
            DBMS_OUTPUT.Put_Line('count of the records: ' || emp_cursor%rowcount);
            DBMS_OUTPUT.Put_Line('deptno: ' || emp_rec.deptno);
            DBMS_OUTPUT.Put_Line('emp no: ' || emp_rec.empno);
            update emp
            set deptno = 10
            where empno= 7566;
            commit;
            DBMS_OUTPUT.Put_Line('after the update');
          end loop;
          close emp_cursor; but the run never shows the record of employee 7566 as one record of the cursor, may be this is the execution plan of the cursor,
    but for the mentioned case, need to re-enter those updated records to the cursor data, to be processed, ( consider that the update statement is conditioned so that not executed always)
    any hints or suggestion
    Best Regards,

    John Spencer wrote:
    Justin Cave wrote:
    Not possible. You'd have to close and re-open the cursor in order to pick up any changes made to the data after the cursor was opened.Then close and re-open it to get any changes made while processing the second iteration, then close and re-open it to get any changes made while processing the third iteration ad infinitum :-)I'm not claiming there are no downsides to the process :-)
    On a serious note, though, the requirement itself is exceedingly odd. You most likely need to rethink your solution so that you remove this requirement. Otherwise, you're likely going to end up querying the same set of rows many, many, many times.
    Justin

  • Whisch one is correct for undo_retention and what is the difference

    Hi ALL,
    whisch one is correct for undo_retention and what is the difference
    SQL> select max(maxquerylen) from v$undostat;
    MAX(MAXQUERYLEN)
    6060
    SQL> select max(maxquerylen) from dba_hist_undostat;
    MAX(MAXQUERYLEN)
    17221

    hi Afzal,
    you can use begin_time & end_time of v$undostat -> to specify the time interval of your interest.
    A brief note, of what you have discussed here:
    maxquerylen
    Identifies the length of the longest query (in seconds) executed in the instance during the period. You can use this statistic to estimate the proper setting of the UNDO_RETENTION initialization parameter. The length of a query is measured from the cursor open time to the last fetch/execute time of the cursor. Only the length of those cursors that have been fetched/executed during the period are reflected in the view.
    V$UNDOSTAT is dynamic, showing current stats.
    DBA_HIST_UNDOSTAT displays the history of histograms of statistical data to show how well the system is working. The available statistics include undo space consumption, transaction concurrency, and length of queries executed in the instance.This view contains snapshots of V$UNDOSTAT
    hope it help.
    regards,
    X

  • How to highlight a line in a text stream and position the cursor at the end.

    I would like to select a line in a text control data stream, highlight the text, and place the cursor at the end of the line so that the text control can be edited at that point.

    Depends on what you mean by "highlight". If you mean highlight in the sense of when you use the mouse to select text, then you can't do that and then place the cursor at the end, since that would effectively "unhighlight" the text. You need to use a different kind of "highlight", like turning the text bold or something. This KB article talks about highlighting particular characters: How Do I Highlight Particular Characters in a String Control?
    See attached for simple example. Modify as needed.
    Attachments:
    Text Select.vi ‏19 KB

  • How does one use the middle and right buttons in AIR without the cursor showing?

    All I want to do is use all three botton clicks without the cursor showing (assistive technology situation). So I use Mouse.hide(). All works fine with the Left mouse button. With the middle and right buttons the cursor reappears as soon as the middle and right mouse is in the DOWN state (and stays visible until rehidden--see code). Are there Mouse parameters that could be added? (I can't find any such references.) Do I need to create a custom cursor Class that makes the cursor invisible at all times? Here is my simple AS 3 test code.
    // MyClickListener.fla
    // Using the Stage to listen for button events
    // Why do the Middle and Right clicks reexpose the mouse cursor as soon as the DOWN state is encountered?
    import flash.display.DisplayObject;
    import flash.events.*;
    import flash.ui.Mouse;
                Mouse.hide();
                var leftClick:int = 0;
                var middleClick:int = 0;
                var rightClick:int = 0;   
    function leftClickHandler(event:MouseEvent):void
                // Mouse.hide();   // I do not need this -- mouse cursor does not reappear
                trace(event.target.name);          
                trace("You pressed the Left Button.");
                leftClick ++;
                trace("Left Clicks = " + leftClick);
    function middleClickHandler(event:MouseEvent):void
                Mouse.hide(); //I use this to rehide the mouse that reappears after click.
                trace(event.target.name);
                trace("You pressed the Middle Button.");
                middleClick ++;
                trace("Middle Clicks = " + middleClick);
    function rightClickHandler(event:MouseEvent):void
                Mouse.hide();  // I use this to rehide the mouse that reappears after click.
                trace(event.target.name);
                trace("You pressed the Right Button.");
                rightClick ++;
                trace("Right Clicks = " + rightClick);
    stage.addEventListener(MouseEvent.CLICK, leftClickHandler);
    stage.addEventListener(MouseEvent.MIDDLE_CLICK, middleClickHandler);
    stage.addEventListener(MouseEvent.RIGHT_CLICK, rightClickHandler);
    Help appreciated.
    Thanks,
    Michael
    Message was edited by: MBM111

    Dear Tuttle and Tom:
    You both sent me to the appropriate place. I downloaded the instruction file (PDF). Many thanks.
    Incidentally, I then downloaded the upgrade offered at the top of that page (from v3.2 to v3.2.4) but after ±90% of the necessary time needed, it shut down with a "Failed to Mount" message (whatever that might mean). It took more than 28 minutes to download that much even though I'm using DSL! Have either of you upgraded to v3.2.4 with or without difficulty?
    Thanks again for your right-on assistance.
    PowerBook G4   Mac OS X (10.4.2)  

  • I NEED a larger cursor & TOOLTIPS because I am visually impaired. In use, the text is always covered by the cursor and as such is unreadable and therefore u s

    Most comfortable AND practical cursor size for me seems to be midway between MAX and MIN. I like a minimum of 12 point text (14 is better) but some text is provided as an image in small type (useless) and many times editors allow 10 or even 8 point text. I don't want or need high contrast, I will not use flashing text, It would be nice to receive consideration and have this nightmare solved.
    Thanks in advance to anyone who can help me.

    For Windows users I may suggest tools and advice from the following site, and It may also be possible to get advice relating to Mac over there.
    * http://www.accessfirefox.org/
    I know in Windows cursor size and features can be modified from the Windows control panel. It may be worth trying to ask on Mac sites to see it thy can help you.
    Regarding modifying text of the browsers webpage content possibly the addon no squint would help you. Or for even higher customisation consider grease monkey scripts
    * https://addons.mozilla.org/en-US/firefox/addon/nosquint/
    * https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
    ** https://en.wikipedia.org/wiki/Greasemonkey
    I do not know if there may already be a suitable add-on for modifying the cursor to meet your requirements you could wade through this listing
    *https://addons.mozilla.org/en-US/firefox/search/?q=cursor&platform=mac

  • Function module for getting the partner details and Classifications

    Hi,
    Can any one tell me FMs for getting the Partner Details and for getting the characteristics associated with an equipment??
    Thanks

    Hi Anu,
    are you talking about the SAP Business Partner???
    Well, if yes, then just check the FM 'BAPI_BUPA_CENTRAL_GETDETAIL'.
    Or just search for oher FMs with BAPI_BUPA*.
    Hope this helps...
    Ciao Bernhard

Maybe you are looking for