1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Cursor concepts

Discussion in 'SQL PL/SQL' started by jbond, Dec 10, 2015.

  1. jbond

    jbond Starter

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    10
    Location:
    India
    Hi experts,
    I am a teacher and I am supposed to teach PL/SQL to my students.
    I am referring a book 'PL/SQL by Ivan byross'. I am right now reading cursor topic. I read following paragraph about cursor in the book and I am not able to understand meaning of it. Please help me to make it clear.

    "If the number of rows returned by oracle engine is more than the area available in the cursor opened on the client, the cursor data and the retrieved data is swapped between the operating system's swap area and RAM"
     
  2. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    Just to provide a bit of background, I've worked with Oracle for 20 years, written a number of books of my own, and regularly communicate with authors from numerous other publishers. PL/SQL is one of my specialties, so I was a bit surprised that I'd never heard of this book. It took me a while to even locate it. Part of the difficulty is because the author is "Ivan Bayross", and part because the most recent version I can find for it was published in 2010 for Oracle 9i. The Oracle PL/SQL engine made some significant changes in version 10g Teaching students today from a PL/SQL book written for a release that has been unsupported for years is not a optimal decision.

    Regarding your question, a cursor is a memory area that is opened in the User Global Area (UGA) of a database session. the UGA is normally part of the Program Global Area (PGA). The PGA is allocated on the Oracle Server machine, not on the Client machine. As such, if you have put in an exact quote from the book -- it appears to be nonsense. You can read a thread from Tom Kyte about cursors here.

    That aside, let's pretend that the statement is 100% correct. What possible use would the information be to someone new to Oracle who is trying to learn to write SQL or PL/SQL? How would this information make them a better SQL or PL/SQL developer? Even if the information were correct, it is useless. My suggestion of a book for you to learn PL/SQL or use to teach others would be Oracle PL/SQL Programming by Steven Feuerstein: http://www.amazon.com/dp/1449324452/
     
    jbond likes this.
  3. koti

    koti Newly Initiated

    Messages:
    2
    Likes Received:
    1
    Trophy Points:
    20
    Location:
    pune
    Hi,

    I want some information about ref cursor can u clarify me, how to use ref cursor as in parameter in procedure.
     
  4. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    Google 'oracle ref cursor parameter'. Read or more of the many fine articles and documentation sources that come up (like this one from Tim Hall at Oracle-Base: https://oracle-base.com/articles/misc/using-ref-cursors-to-return-recordsets ). If after doing some reading on your own you still need assistance, open up a thread and ask a specific question.