7 Replies Latest reply: Jan 17, 2013 5:30 AM by Bawer RSS

    Inline function vs Cursor

    BS2012
      Hi Everyone,
      Please read the article by clicking on the link.

      http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/POP7B/Default.aspx

      Now whatever an inline function is doing, a cursor is doing the same. The program mentioned in it is also using a cusor inside it.

      So what's the exact difference between these objects?



      Regards,
      BS2012
        • 1. Re: Inline function vs Cursor
          Mihael
          Now whatever an inline function is doing, a cursor is doing the same. The program mentioned in it is also using a cusor inside it.

          So what's the exact difference between these objects?
          For each 'location' function users cursor only once, then just return data from memory that is much faster than to use cursor each time.
          But the same result can be achieved using 11g result cash.
          • 2. Re: Inline function vs Cursor
            Karthick_Arp
            What the program does is, Its trying to eliminate the SQL call (The cursor operation) by manually caching the data in a Array.

            I personally feel that is a very bad approach for the following reason

            1. PL/SQL is used in SQL. There is going to be lot of context switch which is going to cost a lot.
            2. Array are used to store value. Arrays use PGA a private memory area which could be expensive.
            3. Lot of code, i don't like to write lot of code.

            The simplest way would be to do a Join with the look up table. This would be the most efficient way of achieving the requirement. Always remember SQL is the fastest way to process your data.
            • 3. Re: Inline function vs Cursor
              BluShadow
              Karthick_Arp wrote:
              What the program does is, Its trying to eliminate the SQL call (The cursor operation) by manually caching the data in a Array.

              I personally feel that is a very bad approach for the following reason

              1. PL/SQL is used in SQL. There is going to be lot of context switch which is going to cost a lot.
              2. Array are used to store value. Arrays use PGA a private memory area which could be expensive.
              3. Lot of code, i don't like to write lot of code.

              The simplest way would be to do a Join with the look up table. This would be the most efficient way of achieving the requirement. Always remember SQL is the fastest way to process your data.
              Agree with that.
              • 4. Re: Inline function vs Cursor
                Bawer
                BluShadow wrote:
                Karthick_Arp wrote:
                What the program does is, Its trying to eliminate the SQL call (The cursor operation) by manually caching the data in a Array.

                I personally feel that is a very bad approach for the following reason

                1. PL/SQL is used in SQL. There is going to be lot of context switch which is going to cost a lot.
                2. Array are used to store value. Arrays use PGA a private memory area which could be expensive.
                3. Lot of code, i don't like to write lot of code.

                The simplest way would be to do a Join with the look up table. This would be the most efficient way of achieving the requirement. Always remember SQL is the fastest way to process your data.
                Agree with that.
                look at this video and their assertions :-)

                http://www.youtube.com/watch?v=ecNP8KBX_sc
                • 5. Re: Inline function vs Cursor
                  BluShadow
                  Bawer wrote:
                  BluShadow wrote:
                  Karthick_Arp wrote:
                  What the program does is, Its trying to eliminate the SQL call (The cursor operation) by manually caching the data in a Array.

                  I personally feel that is a very bad approach for the following reason

                  1. PL/SQL is used in SQL. There is going to be lot of context switch which is going to cost a lot.
                  2. Array are used to store value. Arrays use PGA a private memory area which could be expensive.
                  3. Lot of code, i don't like to write lot of code.

                  The simplest way would be to do a Join with the look up table. This would be the most efficient way of achieving the requirement. Always remember SQL is the fastest way to process your data.
                  Agree with that.
                  look at this video and their assertions :-)

                  http://www.youtube.com/watch?v=ecNP8KBX_sc
                  Can't access youtube at work I'm afriad, and I don't do work at home. ;)
                  • 6. Re: Inline function vs Cursor
                    Karthick_Arp
                    Can't access youtube at work I'm afriad, and I don't do work at home. ;)
                    Same..Same..!! :)
                    • 7. Re: Inline function vs Cursor
                      Bawer
                      BluShadow wrote:
                      ...
                      Can't access youtube at work I'm afriad, and I don't do work at home. ;)
                      cool. I do my work too and am not at home ;-)