Using 2 refcursors within the same procedure

Hi,
Can we use 2 refcursors within the same procedure. This might sound strange. But I have a scenario of doing so- one for dynamically checking for some validations and another for returning a result set.

Yes, go thru the below example.
CREATE OR REPLACE PACKAGE CURSPKG AS
TYPE T_CURSOR IS REF CURSOR;
PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,
DEPTCURSOR OUT T_CURSOR);
END CURSPKG;
CREATE OR REPLACE PACKAGE BODY CURSPKG AS
PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,
DEPTCURSOR OUT T_CURSOR)
IS
V_CURSOR1 T_CURSOR;
V_CURSOR2 T_CURSOR;
BEGIN
OPEN V_CURSOR1 FOR SELECT * FROM EMP;
OPEN V_CURSOR2 FOR SELECT * FROM DEPT;
EMPCURSOR := V_CURSOR1;
DEPTCURSOR := V_CURSOR2;
END OPEN_TWO_CURSORS;
END CURSPKG;
I hope it would be helpful.

Similar Messages

  • Using || and && within the same Powerpivot Calculate syntax

    hi. i'm trying to isolate two groups of users. the 1st is a group who has suffered one of 3 "negative" experiences, without regarding whether or not they also had "positive" ones - i.e., they are the users from the entire population,
    who encountered one of 3 negative statuses in their user lifetimes. 
    the 2nd is based on this group, but users who have ONLY encountered these bad experiences, and never any good experience. for some reason, when i use && to "trim down" the positive statuses from the user group, i end up with the same size
    groups, i.e. the following two codes yield the same powerpivot measure result: 
    =CALCULATE(DISTINCTCOUNT(CDRs[USERID]), 
    CDRs[disposition] = "negative exp 1" || 
    CDRs[disposition] = "negative exp 2"|| 
    CDRs[disposition] = "negative exp 3")
    =CALCULATE(DISTINCTCOUNT(CDRs[USERID]), 
    CDRs[disposition] = "negative exp 1" || 
    CDRs[disposition] = "negative exp 2"|| 
    CDRs[disposition] = "negative exp 3"&&
    CDRs[disposition] <> "positive exp 1"&&
    CDRs[disposition] <> "positive exp 2"&&
    CDRs[disposition] <> "positive exp 3")
    i would love some help on this...
    thx!

    Hi Guy,
    A first stab could be...
    Users with Negative Feedback Only:=
    CALCULATE(
    DISTINCTCOUNT(CDRs[USERID]),
    CDRs[disposition] = "negative exp 1"
    || CDRs[disposition] = "negative exp 2"
    || CDRs[disposition] = "negative exp 3",
    FILTER(
    VALUES(CDRs[USERID]),
    CALCULATE(
    COUNTROWS(VALUES(CDRs[USERID])),
    CDRs[disposition] = "positive exp 1"
    || CDRs[disposition] = "positive exp 2"
    || CDRs[disposition] = "positive exp 3"
    ) = 0
    This solution can almost definitely be re-written more optimally to avoid using a FILTER but should do what you're asking. Let me know if it works as expected and performs acceptably over your data set. The FILTER and inner CALCULATE are just filtering
    out users that have at least one row with positive feedback. I've assumed that this is for a Calculated Field and the syntax is for defining one within the Calculation Area beneath the table in the Power Pivot window.
    Regards,
    Michael Amadi
    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
    Website: http://www.nimblelearn.com
    Blog: http://www.nimblelearn.com/blog
    Twitter: @nimblelearn

  • SO idoc from PO idoc within the same client

    Hello SAP Gurus,
    We need help with the following .
    The requirement is we need to create the Sales order from Purchase order using idocs within the same client .
    We created the partner profile of the customer and the vendor .
    Customer ---maintained an inbound parameters with message type ORDERS and process code ORDE
    Vendor -
    maintained outbound parameters with message type ORDERS and idoc type ORDERS05 and process code ME10 .
    Now when we create the PO and check the status in WE02 we get the error status 56 , EDI: Partner profile inbound not available.
    What could be the posible cause of the error .
    Anybody with some suggestions and solutions .
    Thanks
    Honey

    Hi ,
    You should maintain in the inbound parameters  and out bound parameters also
    out bound parametrs
    message typ[e---ORDERS
    receiver port----
    basic type -
    ORDERS05
    tick on transfer idoc immediately
    Inbound parameters
    message type ---ORDERS
    process code --ORDE
    if you have any further clarifications let me know
    Regards
    Damu

  • How to call 2 refcursor returned by the same procedure

    I have a PL/SQL Procedure that's returning 2 ref cursors.
    How can I call these 2 ref cursors using OO4O Connection in MS Access.
    For 1 refcursor I have the following code:
    Set OraSqlStmt = OraDatabase.CreateSql("begin package_refcur.procedure(:OrdCursor);end;", ORASQL_FAILEXEC)
    How do I call the 2nd Refcur which is returned by the same procedure?

    If you want to populate the two ref cursors and return them to a calling program all you need to do is:
    OPEN cur_var1 FOR
      SELECT *
         FROM tab1
          where rownum = 1;
    OPEN cur_var2 FOR
      SELECT *
         FROM tab1
          where rownum = 2;Now both of the ref cursors are populated.
    Here is an example
    declare
      type obj_curtype is ref cursor
        return all_objects%rowtype;
      type view_curtype is ref cursor
        return all_views%rowtype;
      ref_all_obj    obj_curtype;
      ref_all_view   view_curtype;
      objrec         all_objects%rowtype;
      viewrec        all_views%rowtype;
    begin
      open ref_all_obj for
        select *
        from   all_objects; --PLEASE NOTE NO FETCH INTO
      open ref_all_view for
        select *
        from   all_views; --PLEASE NOTE NO FETCH INTO
      /* The following is here to show you that there is data in the ref cursors
            You could loop through the whole ref cursor.
            In your case these ref cursors are being returned */          
      fetch  ref_all_view
      into   viewrec;
      dbms_output.put_line('view name = ' ||
                           viewrec.view_name);
      fetch  ref_all_obj
      into   objrec;
      dbms_output.put_line('Obj name = ' ||
                           objrec.object_name);
    end;I hope I understood your question and this help.
    Bob.

  • How to use multiple profiles within the same instance of Thunderbird

    About a month ago, I had Thunderbird configured with three profiles,
    and all three could be used within a single startup/instance of
    Thunderbird. That PC is now gone. I have re-configured the three
    profiles on a new PC, but am having trouble making all three
    useable within the same instance of Thunderbird. Can you help?
    Both PCs are/were Windows-7 64 bit.

    Thunderbird only opens on the default if one profile
    or
    if Profile Manager is instructed to ask at startup it will allow you to choose which Profile to open else it opens on the last Profile used..
    So it shows one Profile at a time in one instance of Thunderbird.
    However, one Profile can have many mail accounts.
    eg: I run 4 mail accounts in one Profile.

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • Using an WD Component twice within the same Component

    Hi all,
    our company has made a WD Component for editing business partners.
    My job is to build a WD Component where two business partners (different roles) are edited within the same window.
    My idea was to make 2 separate component usages of the Business Partner WD Component within my component.
    This just works fine. But there is a problem when mapping the context of both Business Partner-Components into my WD Component. There are always naming conflicts. This is because it is not allowed that there are two nodes with the same name in the context, even if they are in different subnodes. Renaming the nodes after mapping them in my component also doesn't work, because it is not possible to rename nested nodes.
    Does anyone know a solution?
    Kind regards,
    Florian

    Hi Anurag,
    thank you for giving me help. You are right, it is possible to use a component twice within the same webdynpro component.
    But the problem is the context mapping in the target component.
    Let me give you an example.
    This is the context of the twice used component.
    CONTEXT
    |
    |->NODE_1
    |  |
    |  |->SUBNODE_1
    |  |  |
    |  |  |->SUBSUB_NODE_1
    |  |  |  |
    |  |  |  |->ATTRIBUTE_1_1_1
    |  |  |  |->ATTRIBUTE_1_1_2
    |  |  |->SUBSUB_NODE_2
    |  |  |->SUBSUB_NODE_3
    |  |  |->ATTRIBUTE_1_1
    |  |  |->ATTRIBUTE_1_2
    |  |->ATTRIBUTE_1
    |  |->ATTRIBUTE_2
    |  |->ATTRIBUTE_3
    Now, if i map this context (NODE_1) to the target web dynpro component I have a problem. I have to map it twice (one time for each used component), so that i can access both used components. But WebDynpro only allows me to rename the node NODE_1. Mapped subnodes (SUBNODE_1, ...) cannot be renamed. So i cannot map the context of both used components, because there are always naming conflicts. WebDynpro doesn't allow that there are two nodes with identical names within the context, even if they are in different subnodes.
    Is there a solution? We really need one.
    Thanks
    Florian

  • I used to be able to "turn on a lightbulb" using the gradient tool in CS5. How do I do it with Creative Cloud? It's not the same procedure.

    I am accustomed to being able to "light lightbulbs" and make candle flame glow with just using the gradient tool in CS5.
    Creative Cloud doesn't work using the same procedures.
    Please help.

    And what program?
    Mylenium

  • Why my iphone produces a bug after it renew for OS5.1.1. The bug is when I use message, type a Chinese word, and then using a releveant word, then the program automately closes. Every time I try the same procedure, it definitely closes.

    Why my iphone produces a bug after it renew for OS5.1.1. The bug is when I use message, type a Chinese word, and then using a releveant word, then the program automately closes. Every time I try the same procedure, it definitely closes.

    Nobody knows? Not even administrators?
    Please it would be really nice to have help on that to take all the benefit of the remote app.
    Thank you very much in advance.

  • Using AS values within the same query

    Is this possible. What would the syntax look like? I am trying to use exp24 result in the same procedure like below.
    Thanks
    Code:
    AS
    SELECT sheet2.id,EmployeeDerivedTable.note,
    CASE
    WHEN EmployeeDerivedTable.note IS NOT NULL THEN 'Bob'
    else 'good'
    END AS exp24
    CASE
         WHEN exp24 = 'Bob' THEN 'Joe'
         else 'bad'
    END AS exp33
    from [dbo].sheet2
    left JOIN.......

    You can use that in this way ->
    SELECT CASE
            WHEN exp24 = 'Bob' THEN 'Joe'
            else 'bad'
           END AS exp33
    FROM (
            SELECT  sheet2.id,EmployeeDerivedTable.note,
                    CASE
                    WHEN EmployeeDerivedTable.note IS NOT NULL THEN 'Bob'
                    else 'good'
                    END AS exp24
            from dbo.sheet2
         )N.B.: Not Tested.....
    Regards.
    Satyaki De.

  • When using Adobe Photoshop CS5, print settings default within the same session.

    Windows 7 Pro 64 bit.  As mentioned after adjusting some settings and printing, the settings reset the next time we go to print the same file within the same session. (never closing the file)

    Hi Chris,
    I will definitely give that a try. I had a tech set up my computer after i purchased it less than a week ago but it is a possibility that he missed it. I will try and run an update this weekend and see if that increases the speed when OpenGL is enabled. I will get back to you on the issue in the next few days.
    Thanks for your insight and helpful suggestion.
    Much appreciated.
    -Darren

  • SSO for various applications within the same portal

    Is it possible to implement SSO at the application level in an EP 7.0 environment?
    Ex:  One Portal with ESS and BI Functionality (BI is connected to the BI backend, ESS is connected to the ECC backend, but all of it exists within the same portal instance) in which the BI Explorer would rely on SSO, while the ESS would require a logon to the portal.  The initial page of the portal would not be a logon screen, but rather a menu screen
    Does this functionality exist?

    For our purposes, ESS would have to be authenticated (perferably through Active Directory), while BI Explorer wouldn't require "visible" authentication, BUT the question would be, could all of this exist on the same portal..
    I agree that it certainly wouldn't be user friendly to ask users to logon (using AD l/p) for certain parts but not others.  I think the solution would simply to have 2 portal instances (ESS/ECC = Logon/Password,  BI Portal = SSO), and to federate the BI to the ECC Portal. That way, if someone wanted to work in BI and only BI, they could go without logging on, but if they wanted to go to the ESS Portal they would have to logon BUT would be able to use both ESS and BI.
    This all stems from an effort to eliminate the neccessity of having to logon to a portal (for a small group of managers), but still maintaining a level of security for ALL users in regards to employee self-service

  • Simple button action that goes to a page within the same doc

    I can't figure this out. I have a button I want to use that takes a person back to the first, or second page of the same doc. It's a catalog section with a table of contents. I need to make links for the pdf that takes people to certain pages within the same document.
    In the Buttons panel, I see how to make the button, but when I assign an action, the only choice that makes sense is "Go To Destination", but I don't get or see any way to choose "page 2" of the document, or another selection method.
    I did this before a few years ago on hundreds of pages, and when I open those old documents up to copy/paste the same buttons, they don't even appear to have actions on them anymore, as if it never happened.
    So, what's the secret? Certainly there's a way to link to another page in the same ID file, no?

    Finally figured it out. I do NOT use the button panel at all. No buttons needed. Just select the grouped object that I want for my button, and hit the "add hyperlink" button in the Hyperlink panel. Then choose "Page" from the menu that opens up and be on my way. What was throwing me for a bad loop, was that I had copied and pasted the button graphic form another document. Well, since the link made previously was broken now, I had the red flag in the Hyperlinks panel...and thus, the "new hyperlink" button was greyed out, sending me in circles. The minute I deleted the old hyperlink it carried over from the old document, the new hyperlink button worked again and all was well.
    Thanks.

  • I subscribed to iTunes Match and would like to sync my music on multiples devices that have different Apple IDs within the same iCloud family.

    I subscribed to iTunes Match and would like to sync my music on multiples devices that have different Apple IDs within the same iCloud family.
    Can someone indicate the way to proceed?
    Thanks.

    Hi,
    You can't use family sharing or multiple Apple IDs with iTunes match.
    ITunes match is only attached to Apple id that you used to subscribe.
    Jim

  • How can I POST data within the same page if I have a A HREF -tag as input?

    How can I POST data within the same page if I have a <A HREF>-tag as input? I want the user to click on a line of text (from a database) and then some data should be posted.

    you can use like this or call javascript fuction and submit the form
    <form method=post action="/mypage">
    cnmsdesign.doc     
    </form>

Maybe you are looking for

  • How to open a file in Bridge with Photoshop CC as default?

    With Bridge open I want to open a file in Photoshop CC but when I click open it opens in Window Live Photo Gallery. When I right click to try "open with" I cant find CC, and it won't give me the option to choose it as the default. What am I doing wro

  • Reader got "not responding" for a minute after click a hyperlink in PDF document

    Hi.  Anyone got similar experience that the Reader hanged for a while after clicked a hyperlink (to an internal website)?  From the NetMon trace, it showed that the Reader made query to our internal DNS with an unknown FQDN (just "com.hk"), then wait

  • Canon 5D Mk II Raw files in CS4?

    Ok, I just bought a new macbook pro with snow leopard , whatever and a new version of cs4 it will not recognize RAW fles from my 5d mkii it just shows them(all un supported RAW files) as a  default icon that has two photos on it  on eon top of the ot

  • Billing plan appears suddenly in ond of the orders

    Dear All, i have a situation where mile stone billing is suddenly appearing in one of the sales orders, where as if i check before or after orders none  of them have on the same day or before or after. since we are using billing plans for other count

  • Converting char data element to curr data element?

    Hi, In one of the transaction we have a custom field (Amount field) - but they used char data element  for this currency field.  And now in this field if we don’t supply amount value in Currency  format then the program is dumping. I need to solve th