Store and restore a sys_refcursor

Hi
I'm building a simple reporting system, and need to cache SQL results. As of the current implementation I use .NET to get a dataset and store that dataset to the database to be able to restore it later.
I wondered if there is a generic way to take any sys_refcursor, store it as XML(or another format) and at a later time, restore it as sys_refcursor again.
It would be nice to schedule the reporting and store the results without including .NET in the picture

Maybe this gives you an idea:
SQL> declare
  2   cur sys_refcursor;
  3   c integer;
  4   x xmltype;
  5  begin
  6   open cur for select empno, ename from emp;
  7   c := dbms_xmlgen.newcontext(cur);
  8   x := dbms_xmlgen.getxmltype(c);
  9   dbms_output.put_line(x.extract('ROWSET/ROW').getstringval());
10   dbms_xmlgen.restartquery(c);
11
12   -- do something with the cursor ....
13   close cur;
14  end;
15  /
<ROW>
  <EMPNO>7369</EMPNO>
  <ENAME>SMITH</ENAME>
</ROW>
<ROW>
<EMPNO>7499</EMPNO>
  <ENAME>ALLEN</ENAME>
</ROW>
<ROW>
  <EMPNO>7521</EMPNO>
<ENAME>WARD</ENAME>
</ROW>
<ROW>
  <EMPNO>7566</EMPNO>
<ENAME>JONES</ENAME>
</ROW>
<ROW>
  <EMPNO>7654</EMPNO>
<ENAME>MARTIN</ENAME>
</ROW>
<ROW>
  <EMPNO>7698</EMPNO>
<ENAME>BLAKE</ENAME>
</ROW>
<ROW>
  <EMPNO>7782</EMPNO>
<ENAME>CLARK</ENAME>
</ROW>
<ROW>
  <EMPNO>7788</EMPNO>
<ENAME>SCOTT</ENAME>
</ROW>
<ROW>
  <EMPNO>7839</EMPNO>
<ENAME>KING</ENAME>
</ROW>
<ROW>
  <EMPNO>7844</EMPNO>
<ENAME>TURNER</ENAME>
</ROW>
<ROW>
  <EMPNO>7876</EMPNO>
<ENAME>ADAMS</ENAME>
</ROW>
<ROW>
  <EMPNO>7900</EMPNO>
<ENAME>JAMES</ENAME>
</ROW>
<ROW>
  <EMPNO>7902</EMPNO>

Similar Messages

  • HT202794 Why can't I download the free Apple apps for my new iPhone 5S? It was set up in store and restored from my iPod Touch 5.

    Why can't I download the free Apple apps for my new iPhone 5S? It was set up in store and restored from my iPod Touch 5.

    Are you logged in with the same account that was used to activate the phone ? If you are, and the apps aren't showing as free, then try logging out of your account by tapping on it at the botto of the Featured tab in the App Store app and then log back in and see if they then show as free.

  • Found an Ipod in the ground.It's disabled and the home button is broken.Can I go to apple store and restore it for me?

    Found an Ipod in the ground.It's disabled and the home button is broken.Can I go to apple store and restore for me for free?

    Apple might be able to restore it, but most likely not. You can pay apple $150 to replace it, but make shure to not mention that you found it.

  • If i factory reset my ipod touch(5th gen), can i reset it as the option 'set up as new ipod', and then i can just go into the app store/itunes store and restore my music and apps and not icloud with photos and ect?

    if i factory reset my ipod touch(5th gen), can i reset it to the option 'set up as a new ipod', and then i can just go into the app store/itunes store and log into my apple ID so i can just restore my music and apps and not icloud with photos, contacts, ect. and then later i can add contacts that i need/want instead of them restoring them from icloud?
    The reason i asked this question is because i have been wondering this a lot ever since i got an exchange on this ipod (and ive only had it for a few weeks now) because my last ipod had a lot of problems. so after i restored my ipod with my computer/itunes, i downloaded apps that i wanted, and then when i went to the storage to see how much storage was left, it said 0 bytes. i was freaking out because i didnt know how that could be, i mean, cause like, that is impossible when i just 'purchased' it, that the space was full but i looked and all my pictures were on this ipod and i already put them on my computer so i dont need them anymore thats why i wanna reset it now so there is nothing on it so i can have more space for stuff to do and download on it.
    it is updated to iOS 8 but that happened when i purchased it, so i didnt have a choice to update it even though i didnt want to update to iOS 8...
    and i hope you understand my problem..
    i would REALLY REALLY appreciate it if someone could tell me a solution to my problem!!! thank you so much!
    -sierra

    Hey Sierra, You can do just what you have stated. My question, what is your "other"? If it is over 1.5 GB you most likely have corrupt files. Doing a Restore to New, Factory restore should correct it. Just make sure you make a full backup of all information on your iPod to your computer before you restore, so you don't lose your stuff, contacts, videos, pictures, non-iTunes music, etc, use the cable and connect with your computer. Then, via cable, connect to your computer, run the Restore to new, don't use your backup. Treat this iPod as if it was your first one ever. When restore is done, set up and add what info you wish to install on this iPod. The music apps etc you purchased should be on your computer, if not you should be able to retrieve purchased apps and music from iTunes. Any music, videos, apps not purchased from iTunes will be lost to you if you do not save them to your computer or the cloud first. When your done, make a current Backup and you should good to go. Hope this helps. Good luck. Cheers.

  • Backing Up and Restoring the Message Store v.s. the queue

    Hello,
    We are running iPlanet 5.2 Messaging Server and need to migrate to another (duplicate) 5.2 Messaging Server. We have all the software installed and the LDAP user accounts created. Now we just need to move the existing mail from one server to the other.
    I found the Backing Up and Restoring the Message Store section in the Admin Guide says to back up and restore your data, Messaging Server provides the imsbackup and imsrestore utilities.
    However I am wondering about the Queue?
    Under <instance>/imta/queue
    What is the difference between the Message Store
    and the Queue? Can I just backup and restore the Queue using tar or cpio?
    Thanks in advance for any advice.
    Regards,
    Tim

    Hello,
    We are running iPlanet 5.2 Messaging Server and need
    to migrate to another (duplicate) 5.2 Messaging
    Server. We have all the software installed and the
    LDAP user accounts created. Now we just need to move
    the existing mail from one server to the other.
    I found the Backing Up and Restoring the Message
    Store section in the Admin Guide says to back up and
    restore your data, Messaging Server provides the
    imsbackup and imsrestore utilities.
    However I am wondering about the Queue?
    Under <instance>/imta/queue
    What is the difference between the Message Store
    and the Queue? The Message Store is where messages get delivered to, so you can read them.'
    The queue is where messages are temporarily stored, pending delivery to wherever they go.
    You can use tar, cpio, or what have you for the queue. Stop the server first. . .
    You then just restore the files to the new server. No need to restart or anything like that. Just dump the files in, and run
    imsimta cache -sync
    to tell the MTA to re-read the queue.
    Can I just backup and restore the
    Queue using tar or cpio?
    Thanks in advance for any advice.
    Regards,
    Tim

  • HT4528 My apps store will not go online with verizon network, but on wifi it works. I am on an iphone 4, verizon.  I tried to do a complete, backup and restore on the phone 1 day before i noticed this problem,  The backup finished the RESTORE would fail c

    My apps store will not go online with verizon network, but on wifi it works. I am on an iphone 4, verizon.  I tried to do a complete, backup and restore on the phone 1 day before i noticed this problem,  The backup finished but the RESTORE would fail I had an error, could not access Apple server ( some server name I cant remember).
    I have plenty of space available on the iphone,
    8gb free,
    ios version- 6.1.3 ( 10B329)
    carrier - Verizon 14.0
    Modem Firmware - 3.0.04
    Can someone help.
    I tried doing my backup restore on the same computer as I once did a year ago. and THis time I cant do the restore on the iphone.
    computer osx is 10.5.8
    itunes version 10.
    I do not wish to go to ios 7 at this time.

    Settings > General > Reset > Reset Network Settings.
    Basic troubleshooting is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.
    If the issue continues, contact the carrier to troubleshoot the network connectivity issues.

  • Hello i just came back from the apple store and they had to restore my phone and i just downloaded all my apps and music back but my photos that are on icloud i only got 80 out of 768 back. what do i do to get all of them back?

    hello i just came back from the apple store and they had to restore my phone and i just downloaded all my apps and music back but my photos that are on icloud i only got 80 out of 768 back. what do i do to get all of them back?

    If you tried to restore to your iCloud backup and your photos didn't fully restore, first go to Settings>iCloud>Storage & Backup and make sure it isn't still in the process of restoring.
    If the restore is complete and all your photos weren't restored, all you can do is try restoring the backup again.  You might try the solution posted by ezjules in this discussion: https://discussions.apple.com/message/19518589#19518589.  This involves opening the photos app after the phone restarts and you provide the passwords for your Apple IDs, then leaving it open for the remainder of the restore process.

  • HT1386 Just downloaded 7.2 into my Iphone 5 what a mess.  Dropped called no audible notifications for email or text messages.  Went to the apple store and reset phone to original specs. Now trying to restore apps and music and itunes will not recognize th

    Just downloaded 7.2 into my Iphone 5 what a mess.  Dropped called no audible notifications for email or text messages.  Went to the apple store and reset phone to original specs. Now trying to restore apps and music and itunes will not recognize the phone.  I have gone thur the steps for windows 7 and still nothing???  I have downloaded the newest version I itunes too. 

    Hi Midwestboy,
    If your iPhone isn't being recognized by iTunes on your Windows machine, you may find the following article helpful:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Regards,
    - Brenden

  • After moving from Canada to the US, getting a new iPhone 5C, and restoring my backup from iCloud, I can't update my apps. I get an error message that my account is not valid in the Canadian App store and I must change to the US store. How do I do that?

    After moving from Canada to the US, getting a new iPhone 5C, and restoring my backup from iCloud, I can't update my apps. I get an error message that my account is not valid in the Canadian App store and I must change to the US store. How do I do that?

    Change here:
    Settings > iTunes & App Stores > Apple ID: > View Apple ID > Country/Region.
    You must have a verified billing address & be located in the country whose store you are trying to use.

  • Can someone tell me how to restore my App Store and iTunes Apps on my iPad 2?

    Can someone tell me how to restore my App Store and iTunes Apps on my ipad 2?

    If you had a backup either in iTunes or iCloud of the iPad you can restore from it by following this article:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    If not you can go into the Purchased section of the App Store App, and download your Purchased Apps from there for free. However their data will not be restored.

  • This is my first time to ask a question, but my iPod touch 4G is not letting me restore and my i have taken it to the apple store and THEY could restore it but then after it shuts off and I can't restore it. Can anyone help me?

    Hi, umm so anyways my ipod is about 2 years old now and i think the reason why it started to malfunction in the first place was because i had too much stuff on my ipod, apps, movies, and junk. But now i took it to the apple store and they were able to restore my ipod but when i go home it goes bad again and i try ot restore it on my laptop and it says it can't restore it. (11) and another thing is that when i try to turn my ipod on, it turns on to the apple logo then all of a sudden theres suppose to be the unlock screen but instead a black screen with a tiny loading sign in the middle and it keeps buffering and it never turns on. and then it shuts off with a white screen and then does the same exact thing for like 10 minutes. please help me. I dont know what to do. and my dad will be very ****** if it cant be helped..D:

    Maybe here:
    http://www.windowserrorhelps.com/itunes-error-11-how-can-i-fix-itunes-error-11-i nstantly
    Is the iPod jailbroken?

  • I am unable to access the app store and certain websites on my ipod touch. I already tried restoring nothing changed. Also it is post ios 6. Can anyone help?

    Not sure what happened but after I downloaded iOS 6 to my iPod touch 4th gen i was unable to use the app store and go on certain websites like yahoo.com, cracked.com and other websites I ussually visit. On top of that the yahoo weather app does not update and always says it fails. I just restored my ipos and nothing changed. Does anyone have an idea of whats going on here?

    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
     Cheers, Tom

  • Help! My ipod classic is not working with the new itunes, it has crashed, i went to the apple store and they restore it but when i came home it just freeze itunes and windows to the point of forcing shut down my pc, is a 160gb ipod classic

    Help!! My ipod classic freeze itunes and my pc to the point of having to force shut down.Help plz i dont know what else to do, i took it to the apple store and they restore for me but when i came home it freezes itunes and my pc, i tried and older itunes, format the ipod and restore it, ran disk erros, am i missing something?! The guy at the shop told me is an "antique" , i bought it a year ago only and barely used it, i feel lile burned money, ipod classic is my favorite model, any suggestions plzzzz!!!!

    Glad 7.7.1 worked for you, I updated itunes on my macbook, and every time i try to sync the music to my ipod classic, it goes for 23 songs and then it freezes and I get "Cannot read or write to this disk", and it ejects it. I tried uninstalling itunes, reinstalling an earlier version (7.6.2) same problem, plus a new issue with itunes. (It was a clean uninstall, btw, I got everything cleaned out, I think, lol). Video's transfer fine. And no good way to get ahold of apple. That's great. If I have no music on my ipod, it's useless. Think they'll give me my money back? (lol)

  • I was warned and I went straight to the site and they were gone.  I didnt was any time. Either way, there should be a way to either store or restore such items. Have you ever lost pictures that were so important to you that you couldnt sleep or eat for...

    I was warned and I went straight to the site and they were gone.  I didnt was any time. Either way, there should be a way to either store or restore such items. Have you ever lost pictures that were so important to you that you couldnt sleep or eat for some time. I have and it wasnt fun. I'm glad that you were able to get yours unlike some of us.

    I am still wondering why iTunes tries to confuse me every time I try to make changes in my preferences, telling me that I "don't have enough permissions", although I am the administrator.
    That's clearly a fault. Whether it's an iTunes problem or a Windows problem I can't say at this time. If you search the Using iTunes for Windows forum for "permissions", you should find threads that can help you sort out this problem.
    Then, changes to the format are not obvious, and I get no notice that I am burning music files as data.
    If you click on a playlist and look at the lower-right of the iTunes window, it says right there what format it will use to burn the playlist.

  • I had my macbook pro system restored at an apple store and now my itunes can't recognize my iPhone. What should I do?

    I had my macbook pro system restored at an apple store and now my itunes can't recognize my iPhone. What should I do?

    Try these:  iPhone, iPad, or iPod touch: Device not recognized in iTunes for Mac OS X, http://support.apple.com/kb/TS1591

Maybe you are looking for

  • IPod Classic 120GB - Can No Longer Sync & Songs Gone From IPOD

    This morning I go sync my iPod and it start giving me some error messages then completely stops. I tried unplugging and plugging the iPod back in. The iPod connects to the computer but will not show up on iTunes. I tried resetting to no prevail. I ca

  • Component properties don't exist anymore.

    I have an component called: Event.cfc Long story short, I init() it by issuing a command like: <cfset eventObject = new 'com.Event'() /> This component has 2 properties: data (a structure) and name (a string). The init() method calls a private method

  • Is it possible to play the whole playlist-folder?

    In iTunes I subdivide larger playlists in multiple smaller ones, by putting them in one folder. I can then play either only the single sub-playlist or the whole folder with every playlist included. The same worked wonderfully with my iPod Classic. Bu

  • Who will have access to data grid

    do end user can have access to Data Grid. general who will have access to data grid i.e both end user and hfm developer can access to the data grid in real time. Can any one pls tell Thanx

  • Automatic distribution of published reports

    Hi all, We have been playing around with the delivery manager API's and have used them to email documents with no problems. What we want to be able to do is take a single data source, generate a separate pdf for each group of elements (lets say for e