DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Print RefCursor takes more time

  1. #1
    Join Date
    Sep 2000
    Location
    VA
    Posts
    343

    Print RefCursor takes more time

    I have a proc returning a RefCursor. Here are my timings on executing it -
    When I execute the package in SQLPLUS, using :
    exec reporting.quiz_roster_report_title(8004, 0, 74113, :c);
    it executes in 0secs.
    When I try to print what is in my refcursor variable using
    print c;
    It takes 56 seconds to return all the data.

    Is this discrepency due to the fact that SQLPLUS needs to do some extra work for displaying the data returned by the RefCursor or does anything else add to this extended time ?

    Thanks.

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Quote Originally Posted by rshivagami
    When I execute the package in SQLPLUS, using :
    exec reporting.quiz_roster_report_title(8004, 0, 74113, :c);
    it executes in 0secs.
    When I try to print what is in my refcursor variable using
    print c;
    It takes 56 seconds to return all the data.

    Is this discrepency due to the fact that SQLPLUS needs to do some extra work for displaying the data returned by the RefCursor or does anything else add to this extended time ?
    No, this discrepancy is due to the fact that you are comparing aples to oven toasters. In your first part (the exec part), you merely opened the cursor, nothing else. No wonder it takes almost no time. But you haven't obtained any data by that, you only opened the cursor in the memory, you haven't even touch the actual data yet.

    But when you isued "print c", you start fetching the actual data from the database tables and returning it to the terminal in a loop, until the last entry from the resultset is returned. And this of course takes time.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width