3 Replies Latest reply: Dec 31, 2012 4:38 PM by TexasApexDeveloper RSS

    Adding ability to use ref cursors in future versions of Apex

    jmr072528
      Currently it has been documented that Apex does not play well with ref cursors and how to get around that. Is this a feature that the Apex team is looking into for future versions? Currently we are using Oracle 11g and 1 g with Apex 4.0.2. Your reply is most appreciated.

      JudJasRis
        • 1. Re: Adding ability to use ref cursors in future versions of Apex
          TexasApexDeveloper
          What exactly are you looking to do with a ref cursor? Maybe you can instead use an APEX Collection?

          Thank you,

          Tony Miller
          Ruckersville, VA
          • 2. Re: Adding ability to use ref cursors in future versions of Apex
            jmr072528
            Hi Tony Miller,

            Thank you for the prompt reply. I see your name in many of the replies in this Apex forum.

            We currently have several package functions that use out ref cursors. We are looking to use the result of that ref cursor for our reports. We have found a way to get around the ref cursor by creating a table collection of the row type and return it in a specific function declaration in a pipelined function. I am fairly new to creating pkgs, functions and specifically pipeline functions as well as learning the many nooks and crannies of Apex. It would be nice to be able to call a predefined ref cursor within Apex. I was just curious if that was a feature that could be developed. Please excuse my lack of knowledge, I am learning though by asking these type of questions.

            Again thank you.

            JudJasRis
            • 3. Re: Adding ability to use ref cursors in future versions of Apex
              TexasApexDeveloper
              Until the APEX development team adds this functionality, I would either :

              1) write a pipelined function that will consume the ref cursor and return your data pipelined to the calling report

              2) write a procedure that will be called prior to your report call, that builds an apex collection that you run your report off of..

              Thank you,

              Tony Miller
              Ruckersville, VA