Solved

Pro*c  cursor rowcount

Posted on 2004-10-27
1,564 Views
Last Modified: 2008-02-01
Is there any way of telling how many rows there are in a declared cursor BEFORE fetching the data?
A colleague suggested that there may be an attribute of SQLCA which will give me that but they have gone home and I can find no reference for SQLCA or how to use it!

Anyone got any ideas? The alternative would just be to do a count(*) of the SELECT statement, but I shouldnt have to!

Julian
0
Question by:stummj
    8 Comments
     
    LVL 75

    Accepted Solution

    by:
    Don't think you can get there from here........

    I know that rowcount for a cursor provides the number of rows processed.  I don't know of any way from SQLCA to obtain this.
    0
     

    Author Comment

    by:stummj
    rowcount gives the number of rows selected even before the fetch? Are you sure?!
    0
     
    LVL 75

    Expert Comment

    by:slightwv (䄆 Netminder)
    Am I sure of what?  I'm confused.......(which is really nothing new)....
    0
     
    LVL 15

    Expert Comment

    by:ishando

    >> "I know that rowcount for a cursor provides the number of rows processed."

    ie. after the fetch
    0
     
    LVL 75

    Expert Comment

    by:slightwv (䄆 Netminder)
    ishando:  Thanks for the clarification (I thought that was implied.....it's kind of hard to process a row that hasn't been fetched)
    0
     

    Author Comment

    by:stummj
    Thanks for trying but thats not what I asked.
    I want to know if there is a way once you have the declaration whether you can determine how many rows in the select.
    0
     
    LVL 15

    Expert Comment

    by:ishando
    Not without doing the fetch - your alternative of doing a count would be the way to get this info
    0
     

    Author Comment

    by:stummj
    Isnt there an attribute of the cursor itself? How is space reserved? I would have thought that once the cursor is declared, some space is reserved for it?
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
    Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
    This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
    This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now