How to add results of Loop into a Cursor

Hi,
I am opening a cursor and looping through each row (it has a select query that queries based on the value of a column obtained from another cursor).
How can I add all the rows to a new cursor (along with the column value I am getting from the first cursor), as I want to return that to a java program.
Can I create a new cursor and add the final data to it (that contains all rows), if yes How do I do that?
Thanks,
Rommel.
Message was edited by:
rommelsharma

Trying to add data from one cursor to another cursor shows a basic misconception on your part of what a cursor is.
First, what a cursor is not - it is not a result set. An in-memory set of rowids or results for a SQL. With 1000's of cursors on a database, how would this scale when every cursor needs space for storing its results?
A cursor is a SQL program - a set of instructions (as per the SQL's execution plan) of how to get the results for that SQL. When a cursor fetch is performed, this program returns the next set of rows from the actual database tables.
So you cannot take data from one or more cursors and then wrap that into a 3rd cursor.. or more accurately, you should not. The fact that it can be hacked in PL/SQL simply says a lot of the flexibility of PL/SQL.. and not about good sensible use.
So how then do you "add cursors" together? You do it at SQL level. A cursor is a program. So instead of creating multiple programs, each returning its own results, you make it a single program.
You combine the SQLs. This means using UNION, JOIN, INTERSECT, etc.
Solve the problem in SQL first and foremost. That is the most powerful language to use to crunch database data. Do not make the major and fatal performance mistake of treating SQL as a simplistic I/O library for merely reading and writing records.

Similar Messages

  • How to add more disk space into /   root file system

    Hi All,
    Linux  2.6.18-128
    can anyone please let us know how to add more disk space into "/" root file system.
    i have added new hard disk with space of 20GB, 
    [root@rac2 shm]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda1             965M  767M  149M  84% /
    /dev/hda7             1.9G  234M  1.6G  13% /var
    /dev/hda6             2.9G   69M  2.7G   3% /tmp
    /dev/hda3             7.6G  4.2G  3.0G  59% /usr
    /dev/hda2              18G   12G  4.8G  71% /u01
    LABLE=/               2.0G     0  2.0G   0% /dev/shm
    /dev/hdb2             8.9G  149M  8.3G   2% /vm
    [root@rac2 shm]#

    Dude! wrote:
    I would actually question whether or not more disks increase the risk of a disk failure. One disk can break as likely as one of two of more disks.
    Simple stats.  Buying 2 lottery tickets instead of one, gives you 2 chances to win the lottery prize. Not 1. Even though the odds of winning per ticket remains unchanged.
    2 disks buy you 2 tickets in The-Drive-Failure lottery.
    Back in the 90's, BT (British Telecom) had a 80+ node OPS cluster build with Pyramid MPP hardware. They had a dedicated store of scsi disks for replacing failed disks - as there were disk failure fairly often due to the number of disks. (a Pryamid MPP chassis looked like a Xmas tree with all the scsi drive LEDs, and BT had several)
    In my experience - one should rather expect a drive failure sooner, than later. And have some kind of contingency plan in place to recover from the failure.
    The use of symbolic links instead of striping the filesystem protects from the complete loss of the enchilada if a volume member fails, but it does not reduce the risk of loosing data.
    I would rather buy a single ticket for the drive failure lottery for a root drive, than 2 tickets in this case. And using symbolic links to "offload" non-critical files to the 2nd drive means that its lottery ticket prize is not a non-bootable server due to a toasted root drive.

  • How to add my own pdf into "Kobo Books"?

    Anyone knows how to add my own PDFs into "Kobo Books"?
    The "Adobe Reader" in playbook doesn't have bookmark function.

    Because the Adobe Reader pre-installed in Playbook doesn't have Bookmark function, while kobo has it.

  • How to add a ChartOfAccounts object into the database.

    how to add a ChartOfAccounts object into the database. please shows sample code
    thanks

    Dim CoA As SAPbobsCOM.ChartOfAccounts
                CoA = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oChartOfAccounts)
                CoA.Code = 11223344
                CoA.ExternalCode = "a1234"
                CoA.ForeignName = "f Test Account"
                CoA.Name = "Test Account"
                CoA.AccountType = SAPbobsCOM.BoAccountTypes.at_Other
                CoA.ActiveAccount = SAPbobsCOM.BoYesNoEnum.tYES
                CoA.FatherAccountKey = 100001
                If CoA.Add <> 0 Then
                    MessageBox.Show(oCompany.GetLastErrorDescription)
                Else
                    MessageBox.Show("Added Account")
                End If
    Remember the father account key must be a valid account number in the company where you are trying to add the new account.  (The G/L Account code seen in the SBO client)

  • How to add a function field into the existing matrix report

    Hi,
    I have a matrix report , now i wanted to add one moe field into the matrix which is getting the value from a function , this function is a part of the ref cursor query(group) , i'm able to get the value from the function but it cannot display on the existing matrix report. i wanted to add this in the repeating frame which is printing down. how could i do this , looking for your help. thanks . bcj

    Here the scenario like,
    Data from Table_1
    NAME UNITS DAYS RATE
    AAA 10 1 1.2
    BBB 12 2 3.1
    AAA 20 2 4.1
    CCC 23 1 5.2
    Here, In the matrix report the NAME and UNITS are row fields and 'DAYS' is column field , RATE would be the cell field, and
    Data from Table_2 ,
    NAME BASIC
    AAA 2
    AAA 2
    BBB 2
    CCC 3
    In the report i have to display the 'BASIC' along with the NAME in row level ( repeating frame printing down),
    To get the multiple 'Basic' for each 'Name' using a ref cursor .
    and, using a function to do further calculation based on the basic value
    begin
    select basic into v_basic where name =:name;
    return(caluculated_value);
    end;
    and return the calculated value to the report. But at that time cannot accommodate the value in the matrix report with other groups frequency.
    looking for your valuable help. Thanks Bcj

  • How to add a new printer into printer list?

    Dear all,
    May I know how to add new printer into my printer list in SAP system? My company SAP is SAP 4.0B. Can any one please teach me how to add printer step-by-step?
    Thanks alot!!
    PC

    Solved

  • How to add a new value into message choice ?

    Dear all,
    I have a messageChoice component in my OAF page and I binding it with my VO (the VO is based on my query SQL in controller, NOT based on EO).
    For example, the query result of VO is as following:
    columnName, columnValue
    a, 1
    b, 2
    c, 3
    And I binding them into my messageChoice component as following:
    myChoice.setPickListViewUsageName("myVO1");
    myChoice.setListDisplayAttribute("columnName");
    myChoice.setListValueAttribute("columnValue");
    myChoice.setPickListCacheEnabled(false);
    Now I want to add a new combination into te messageChoice component, such as 'd, 4'.
    So I write it like this:
    myChoice.addOption("d", "4");
    But it doesn't work. The result of choice is still the same as before.
    So I think maybe I can use myVO1.createRow() method, but when I run my page, it raise an error message: "myVO1 is read only" :(
    Should I have to add a "UNION" in my query SQL of VO for this requirement?
    Any other ideas, please?
    Thanks.
    Kenny

    If you know the values to be added in advance, then its a better option to put them in VO itself with union clause and it has a better performance compared to runtime modification to VO.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to add a virtual disk into a 'guest VM' after VM has been created?

    Well, it was easy when one need to add a virtual disk before creating a guest VM. All need to do was to edit the template and click on disk tab and create a virtual disk.
    However the challenge comes after created a 'guest VM'. I need to add additional virtual disk into this 'guest VM'.
    This is what I did.
    Click on Repositories tab --> Under repositories--> Virtual Disks. There is a green "+" sign. Click on it. It says create virtual disk. Follow the instruction, I enter the virtual disk name, size, and select if it is spare or non-spare. Hit ok. Well, everythings seems fine.
    Next, I click on the "blue folder" icon which indicated import virtual disk. It asked me about Virtual disk download location.
    According to the manual, http://docs.oracle.com/cd/E27300_01/E27309/html/vmusg-repo.html#vmusg-repo-vdisk
    Virtual Disk download location: The URL for the virtual disk file. The URL protocols supported are HTTP, HTTPS, and FTP. For example:http://example.com/vdisks/myvdisk.img
    How can I determine what is the URL in my case?
    Where is the newly created virtual disk located? Isn't it supposed to be in Oracle Server? But it doesn't have  a http server running there.
    Please help.
    Thank you.

    Virtual disks can only be added and removed at runtime from a PVM. You don't even need to know anything special. Just create the vdisk and use the VMs settings to occupy another slot with the new vdisk.
    But as I said… this works only with PVMs, not HVMs. In case of a HVM, you will need to shut down the VM and add the disk afterwards, then fire it back up.
    The little folder with the blue down arrow is for importing an existing vdisk file from a web- or ftp server. If you have already created the vdisk, you won't need that.

  • How to add static resource file into the NetBean project

    I have several static data files(such as icons, images and etc.) need to be loaded by the program. How to add them into the NetBean project?
    Thanks

    Try a NetBeans forum. This is the Java Compiler forum.

  • How to add a hide data into an appointed image of the pdf

    Can I add data into an appointed image and hide the data?
    if can not add hide data in image, can I  add hide the data into the other layer  of   the pdf?
    Can anybody give me some tips?
    thanks!

    My code:
    ASFile hddatFile = NULL;
    ASPathName hidedataFile = ASFileSysPathFromDIPath (ASGetDefaultFileSys(),  "e:/myInfo.txt", NULL);
    if (hidedataFile == NULL)
         AVAlertNote("not yet");
    ASInt32 hidedataVal = ASFileSysOpenFile(NULL, hidedataFile, ASFILE_READ, &hddatFile);
    if (hidedataVal != 0)
         AVAlertNote("隐藏数据加载失败!");
    CosObj imgCos;
    PDEImageGetCosObj(pdeImage, &imgCos);
    CDocument cDocument;
    ASAtom Seal_K = ASAtomFromString("ADBE:Mytest");
    CosDictPut(imgCos, Seal_K, CosNewInteger((CosDoc)cDocument, false, ASFileGetEOF(hddatFile)));
    I'm not sure whether I have set the hide data in the picture success? there is not a return value to know it.
    when I use this code to get data:
    CosObj stream;
    PDEImageGetCosObj((PDEImage)pdeElement, &stream);
    CosObj nameCosObj = CosDictGet(stream, Seal_K);
    the return value (nameCosObj is (0,0)).  I dont know why? and if I get the cosObj, How to get my hide data?
    Where I do wrong?
    thanks for Leonard !

  • How to add a filter/selection into the report title?

    Hi experts,
    Currently I try to fugure out how to set up a field into the page header (title) of a report in order to dynamically adapt the title to selected filter criteria. I tried to use the Reprot Filter Summary, but since I do have several sheets in my reports the information given through it is not applicable.
    What I would like to achieve is that the end user can select e.g. a category X and Y and the title says: "Report title - categories: X,Y" Somthg like this. I'd appreciate any tips.
    Best regards

    Hi guys,
    thanks so far. I managed to show prompts in the report. But still my problem is nor 100% solved
    I would like t achieve that the filtered criteria in the report title is separated through a comma like in the report filter summary - e.g.: {001, 002, 003, 004} followed by just 1chart/table that is including the whole information.
    When I however just drag a variable into the report it automatically created different sections, right? Like ........ table, chart, whatever... .......table chart whatever........
    Regards

  • How to add the error message into Delivery Error Log (VL10A,VL10X)

    Hi,
    I have a to add my custom message into Delivery creation error log (VBFS, VBSS)
    This message should be shown in the Collective process log (VL10X, VL10A).
    Please give me the soln to solve this problem.
    I have searched in SDN, i didnt get the proper solution
    Thanks
    Shankar

    HI,
    Make use of the BADi "LE_SHP_DELIVERY_PROC"
    Use the method DELIVERY_FINAL_CHECK.
    Pass the error messages in table CT_FINCHDEL.
    Regards,
    Ankur Parab

  • How to add a website link into a final cut video

    Does anyone know how to add a website link that someone can click on that I can add to a video I might be creating in Final Cut Express? I am looking for an easy way to do this and I cannot find one. Thanks.

    I believe Media100 is the only application that can do this. Or at least it used to, don't know if it still does. There is a company called VideoClix that can create hot spots on QuickTime files. The technology is in QuickTime, who'd just have to learn how to do it.

  • How to add document navigator control into a plug-in window?

    I develop a filter plug-in for Photohsop CS2, but I wonder how to add navigator controll in the plug-in window. The navigator works int the same way like Photoshop navigator - moving cursor on the navigator makes the image scroll in the main previes. I want to have both, the navigator and a main preview window in the filter plug-in window. I saw it many times, however, I did not find example in Photoshop CS2 filter SDK.
    If somebody could point me to a resource, that could get me to the right track, i would be glad.
    Thanks
    Rene.

    Chris hello,
    It is good to know that plugins can not control the docunment view in Photoshop. However, my idea was to have preview in Photoshop plug-in window, and then to have small navigator that would scroll the preview. Exactly like on this Photoshop plug-in:
    http://data.unipixels.com/screenshot.jpg
    Please notice tha navigator on the right side of the window. Moving the red rectangle in it will scroll the middle preview window.
    With regards,
    Rene.

  • How to add a html file into JEditorPane

    Hi
    I am doing an aplication on swing.But I don't know how to add a html file to the JeditorPane keeping the html file on the source code. i.e my html file is in my source code.Then how to add this html file to Jeditor pane.
    Thanks
    Srikant

    QuickTime requires player and plugins that most people don't have.  You'll reach a much wider audience if you use HTML5 <video> with mp4, webm and ogg files.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 with Video</title>
    <!--help for older IE browsers-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>
    <style>
    video {
        max-width:100%;
        display:block;
        margin:0 auto;
    </style>
    <body>
    <h2>Use 3 File Types to support all browsers &amp; mobile devices:  MP4, WEBM and OGV.</h2>
    <h3>Online Video Converter
    http://video.online-convert.com/</h3>
    <!--begin video-->
    <video controls poster="Your_poster_image.jpg">
    <!--these are 6 sec sample videos for testing purposes. Replace sample-videos with your own files-->
    <source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm">
    <source src="http://techslides.com/demos/sample-videos/small.ogv" type="video/ogg">
    <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
    If you're seeing this, you're using an
    outdated browser that doesn't support
    the video tag. </video>
    <!--end video-->
    </body>
    </html>
    Nancy O.

Maybe you are looking for