Inconsistent behavior of DML instructions pulled after the opening of a sysrefcursor

Hello

I have a question about the way that a sys_refcursor behaves when it is followed by an update performed on the line returned by the cursor. Thank you for your explanations!

Problem:
I have a procedure that returns a sys_refcursor with one line of a table corresponding to the input parameters passed. within the procedure, I first open the sys refcursor to return one row that matches the input parameter values. the following statement is a delete operation, which deletes the line just extracted by the sys_refcursor returned before the DML. On execution of the procedure, the sys_refcursor still shows the deleted row, even if the line has been removed from the corresponding table. Now, say instead of delete the line taken by the cursor, I insert a line after the sys_refcursor. In this case, even if there was no record in the table when the sys_refcursor was opened, on the execution of the procedure, the newly inserted row is returned. Finally I want to update that follows the line returned from the refcursor output. In this case, exit sys_refcursor does not return the line, even if it is updated after the cursor is opened. To summarize, sys_refcursor in the output displays the snapshot before the insertion/deletion fired on the corresponding table, while sys_refcursor in the output shows the snapshot once the update of fire on the corresponding table. Why this behavior? Can someone please explain this?
Say the emp table has the following features:
EMP_ID, EMP_NAME
---------- -------------
Sam 101
friend of 102
---------- ------------
Case for delete: Say entry in_emp_id = 101

create or replace procedure is demo (in_emp_id in number, out_data to sys_refcursor)
Start
Sys_refcursor open for select * from emp where emp_id = in_emp_id;
delete from emp where emp_id = in_emp_id;
commit;
end;
OUTPUT:
EMP_ID, EMP_NAME
---------- -------------
Sam 101



Case with insert: Say entry in_emp_id = 102

create or replace procedure is demo (in_emp_id in number, out_data to sys_refcursor)
Start
Sys_refcursor open for select * from emp where emp_id = in_emp_id;
Insert into emp values(102,'john');
Commit
end;
OUTPUT:
EMP_ID, EMP_NAME
---------- -------------
John 102


Case update: tell of entry in_emp_id = 102


create or replace procedure is demo (in_emp_id in number, out_data to sys_refcursor)
Start
Sys_refcursor open for select * from emp where emp_id = in_emp_id;
Update emp set emp_id = 103 where emp_id = in_emp_id;
commit;
end;
OUTPUT:
EMP_ID, EMP_NAME
---------- -------------

Hello
You have probably made a mistake somewhere in the order of tests, I have three tests return the expected results, namely the State of the table at the time of the statement "open for".

Tags: Database

Similar Questions

  • Crash after the opening of windows 7 32 bit

    After the opening of firefox mi 27.0.1 I have to wait 1-2 seconds and after that it freezes and mozilla crash report it opens automatically, I tried to choose 'win xp sp3' compatibility and she almoust works, the flash player, that it does not, the icon on the task bar that it flashes, the window of flash player (youtube player) a black and wite quickly switch I tried to reset firefox also! Preobrajensky administrator,

    The most recent report is a problem with the Shockwave Flash plugin.

    • Firefox 27.0.1 crash [@ F1398665248___]

    You can check for problems with the current versions of the plugin Shockwave Flash and try this:

    • Disable protected mode in the plugin Flash (Flash 11.3 + on Windows Vista and later versions)
    • turn off hardware acceleration in the Flash plugin

    See also:

  • New tab - how to type in the url after the opening of new tab?

    Work on Firefox for windows 19.0.2. I imported the firefox profile everything from the old computer to a new one – after importation, a thing is broken:

    -When I open a new tab (topic: setting newtab) it opens a new tab with the tiles of sites previously used well, but I need to click on the address bar of browser-> first while on the machine to another, in my opinion, the default setting is that I can type in the Url bar immediately after the opening of the new tab to any address manually in the browser to the URL (without the need of) (click on the additional url bar)-j' I hope you understand you what I mean). A way to restore this feature?

    Thanks in advance

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the start safe mode window or make changes.
  • How to let axSequenceView view the sequence file, after the opening before the race.

    How to let axSequenceView view the sequence file, after the opening before the race.

    I would do it differently, you do not see when running because your sequence control is connected to the requeteexecution Manager. I have two controls of the same size that sits on top of the other, one connected to requeteexecution as it is by default and the other to SequenceFileView Manager.

    You can then use reminders to start execution and execution of end events in the user interface to make the control visible. It is very easy to achieve.

  • Windows XP Pro on which I run several programs. After the opening of a few applications, I have this message "not enough memory".

    Hello

    I have a PC running Windows XP Pro on which I run several programs. After the opening of a few applications, I have this message "not enough memory".
    When I have this message, I can't open another application, or those in Windows... I have 2 GB of memory and only 700 MB are used.
    If I open the calculator several times (about 65 times), I have the same result.
    Sometimes, I get no error message, but the application does not open.

    Someone knows why?

    Thank you

    Hello

    You did the chnages on computer before this problem?

    I suggest you go through the steps of the following atrticle.

    "Not enough memory" error message appears when you have a large number of programs running.

    Note: Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:
    322756 (http://support.microsoft.com/kb/322756/ )
    How to back up and restore the registry in Windows.

  • After the opening and reading of a new email from Windows Mail Inbox, it disappears

    After the opening and reading of a new email from Windows Mail Inbox, it disappears the next I open Windows Mail or switch to another folder and back to the Inbox! Please advise!

    View | Current view. Make that sure show all Messages is checked and nothing else. (Like hiding Messages).

  • After the opening of the CC 2015.  ERR_File_Not_ found

    Hello

    you are looking form Dreamweaver CS6 in the CC2015. Installation went well. But after the opening of CC2015, there is an error:

    Dreamweaver kan het you laden 'file:///Macintosh%20HD/Applications/Adobe%20Dreamweaver%20CC%202015/Configuration/Conten t/Welcome/HTML5/start_content.html' bestand niet vinden.

    ERR_FILE_NOT_FOUND

    The file is located in the folder

    Also when I want to start a new document, this error occurs:

    Dreamweaver kan het you laden 'file:///Macintosh%20HD/Applications/Adobe%20Dreamweaver%20CC%202015/Configuration/NDD/br owsercontent/NDD_Browser_UI_Main.html' bestand niet vinden.

    ERR_FILE_NOT_FOUND

    I reinstalled CC2015 and performed a clean installation with the creative cloud Panel. Same error occurs.  Again deleted. restart the Mac and still the same error.  Then he makes aganin on a Macbook and the same thing happens again.

    What is a big?  Using always the latest updates and versions of Mac OS x

    Ruud

    Hello

    This problem occurs when there is a problem with the folder-names files with the same name is located inside your volume, or install Patch with some special characters (which is not the case in your installation path) etc. Can you please check if you have folders with the same name or something? If yes try to re - appoint.

    You can check this thread with a similar problem - Re: file not found error in the homepage

    Thank you!

    Kusha

  • How to create a task that runs once a day, immediately after the opening of session?

    Hello, I'm wondering how to create a task using the Task Scheduler that runs once a day, immediately after I have logon.

    The reason is I want to use Bing Desktop to change my wallpaper every day. However, I just want to run the first time I start my computer every day, so it will change the wallpaper. By default, it starts whenever I have to logon. It's annoying, because I just want it to start once a day to change the wallpaper. However, using the Task Scheduler, I put only a trigger to start "at the opening of session' or"once a day." If I choose once per day, it runs about 5-10 min after I login, instead of logon immediately after. If I choose the two triggers, then it starts after each session.

    Basically, I just want the Task Scheduler to launch the program after the connection the first time I connect to the computer on any given day. How can I do this?

    Hello Jeffrey,.

    You can refer to the links below and see if that helps.

    Create a task

    http://TechNet.Microsoft.com/en-us/library/cc720110 (v = WS.10) .aspx

    Modify a scheduled task

    http://TechNet.Microsoft.com/en-us/library/cc778308 (v = WS.10) .aspx

    Change an existing task

    http://TechNet.Microsoft.com/en-us/library/cc766442.aspx

    Please write back to us for assistance and we will be happy to help you come.

    Thank you

  • CC gel Lightroom CC crashing immediately after the opening

    all my Adobe CC does not work as if it were a complete mess, I'm super irritated because not all of my settings were transferred in the which versions updates were released and I try to make everything synchronized. I don't have 4 versions of photoshop on my system or 2 versions of lightroom. I need a fix that keeps all my settings and destroys any additional programs that I don't need. the creative cloud app does not load my application page it just freezes, I spent a whole day trying to fix it myself without success and need help. also the cc lightroom does not open he crashed after the startup screen every time. I am beyond frustrated.

    Hi Shannon,

    Please uninstall the old applications using the information below:

    Uninstall or change a program - Windows help

    OS X Yosemite: install, update and uninstall applications

    and for the rotation of the wheels on the applications tab:

    * Please complete all Adobe (Windows) Task Manager process & Activity Monitor (Mac)

    Try the solutions below

    Adobe Creative Cloud desktop application does not open or shows a spinning wheel of progress

    Kind regards

    Chirag

  • How to add a tracking code after the opening < body > tag on a Master Page?

    I would use Google tag on my Adobe Muse site manager.  I do not see how to add a snippet of code in the Head of a page section but Manager tags Google recommends to apply the code after the body opening < body > tag of each page due to its use of iframes.   Can someone tell me how to proceed?

    Thank you

    Hello

    Could you please check this thread,

    Re: Errors tag Google in Adobe Muse Manager

  • LR crashes after the opening of module development

    Very often at the opening (or seconds) the module development, Lightroom crashes. I have no idea what may cause this!

    I am running Windows 10 Familly (64-bit) version. Lightroom is in demo, version 2015.2.1 and I use a converted LR 4.x with about 6500 pictures catalog. In fact, I have an old license of LR installed on another computer and I'm looking to go to LR CC for my new computer. But with all these crashes...

    Is that someone already had this kind of problem?

    Hi Sam_BulldogsFactory,

    This could be due to the incompatibility of graphics card or issue drivers.

    You have to go in the Lightroom preferences > performance > uncheck the option use the graphics processors

    In addition, Lightroom preferences > General > uncheck "Add Photos Screen.

    and relaunch Lightroom.

    In addition, you can consult this article: using Adobe Photoshop Lightroom | Graphics processor (GPU) acceleration, troubleshooting & FAQ Lightroom

    Kind regards

    Claes

  • Screen turns off after the opening of the session. The mouse cursor only appears

    Don't know where to post this, but here's my problem.

    I have a Dell laptop with VISTA professional who has worked perfect for 8-9 months. Since the beginning of December I started having this problem haunting log-in where to provide the user name and password, the screen turns white (black) and I see is a mouse cursor. Nothing else appears. I can get to the hostel Monsignor task by doing a Ctrl-Alt-Delete, but a stop or restart is not the problem. I tried the safe mode or VGA mode without result. The only thing that seems to work is time. If I leave the system at the prompt to logon for 5-10 minutes, I can then connect you ok but this delay is unacceptable. It's as if there is a service that needs timeout? Any ideas on what may cause this behavior?

    The behavior is also described by others here and here but none of the suggestions have solved the problem for me.

    Appreciate any help. Thank you!

    -Jetland

    You wanted to let you know the final outcome of this problem. I spent two good months of fighting through this problem and try all of the advice given. The problems have persisted. Beyond the suggestions here, there are pages on Google pages on this topic is delicate balancing sifting through the "answers".  So far, no one, including Microsoft, has been able to identify the problem or to locate a formal resolution. After having satisfied this during a road trip in 2 weeks, I have downgraded to Windows XP and wait anxiously for the release of Windows 7.

    -Jetland

  • Black screen on computer Lenovo Yoga Pro 2 after the opening session in Windows 8 screen

    I return this laptop Lenovo Yoga Pro 2 about a month and it has Windows 8. I start the laptop and once I enter username and password, I have a black screen with the mouse pointer. Lenovo support has been useless. They asked me to run c:\windows\system\restore\rstrui.exe by using the Task Manager, but I get the file not found. When I go to the command prompt by using the Task Manager and check dir listing in the directory of restoration, it shows empty.

    Very frustrated. Can someone please help here on the Microsoft Forum?

    Thank you in advance.

    It seems to me a solution, it worked for me, so hopefully it will work for you as long as you experience the same problem.

    Because you can always go to the sign in screen, do the following:

    Click on the power icon in the lower right to open the menu,

    Hold down the SHIFT key while clicking the button of /restart/ once.

    A screen will appear after a few moments.

    Click and follow the instructions /Refresh/ and let him go during its cycle...

    all fixed!

  • Thunderbird is suspended ("Not Responding") seconds after the opening (ver. 38.4.0). Likely related to Avast.

    After a recent update 38.4.0, Thunderbird does more completely. I have to kill the process, and then whenever I open Thunderbird thereafter, it crashes a few seconds (even 'unresponsive' freeze-up).

    Sometimes in SafeMode as well of TB and with disabled Avast. Thunderbird works normally for some time after a restart of Windows 7 before crashing again. So, start in Windows safe mode are not conclusive.

    Are there additional troubleshooting I can do? I am sunk now, as Thunderbird is watered seriously! Is it possible to revert to a previous version?

    Thunderbird has been relatively stable in recent weeks. Maybe the TB or Avast updates have solved the problems of gel. Thank you for the thoughtful troubleshooting.

  • Zoom function disabled so can't enlarge the text on the main screen hard to read the subject lines of e-mail messages, looks like 6 pt type size, activated after the opening of e-mail.

    The text size is so low in the views of folders for primary e-mail that it is very difficult to read the subject lines of emails. I think I remember that earlier versions 'Zoom' has been activated and you could adjust the size. Looks like that the size is set at approximately 6 pt type. Must be at least 12 points. Thanks, C Sanders

    I thin you will find that it is this add-on you are looking for https://addons.mozilla.org/en-us/thunderbird/addon/theme-font-size-changer/

    Installation instructions http://chrisramsden.vfast.co.uk/3_How_to_install_Add-ons_in_Thunderbird.html

Maybe you are looking for