No of Rows for DBMS_SQL.EXECUTE
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: No of Rows for DBMS_SQL.EXECUTE

Hybrid View

  1. #1
    Join Date
    Feb 2004
    Location
    Mumbai, Maharastra
    Posts
    67

    No of Rows for DBMS_SQL.EXECUTE

    Need to get the TOTAL count of no of rows that is retreived from SELECT statement for DBMS_SQL.EXECUTE. Is there any subprogram in DBMS_SQL.EXECUTE which gets me the no of rows retreived from a SELECT STATEMENT in DBMS_SQL.EXECUTE.

    It should function the way SQL%ROWCOUNT functions.

    Things which dont satisfies the above requirement in DBMS_SQL is as follows:
    DBMS_SQL.EXECUTE_AND_FETCH
    DBMS_SQL.FETCH_ROWS
    DBMS_SQL.LAST_ROW_COUNT

    Could any one put some thought into it.
    Regards,
    Surajit K Mitra

  2. #2
    Join Date
    Nov 2005
    Posts
    1
    Hi,
    I try to find some function in DBMS_SQL , but there's nothing to do this.
    But I can propose you two workarounds.
    1. If you fetch data row-by-row you can count rows in varaible.
    2. If you fetch data in bulk array , you can get array row's count

    I hope this help you.

  3. #3
    Join Date
    Feb 2005
    Posts
    158
    Trick question.
    DBMS_SQL.EXECUTE doesn't fetch any rows. In fact, for a SELECT it doesn't really do anything much.
    Basically, you need to fetch all the rows before you know how many rows you are going to fetch.

    Or at least fetch one row, with a nice analytic function to tell you how many rows will be fetched, such as :
    SELECT table_name, column_name, COUNT(*) OVER ()
    FROM user_tab_columns

  4. #4
    Join Date
    Feb 2004
    Location
    Mumbai, Maharastra
    Posts
    67
    thanks,
    i can live with the solution.
    Regards,
    Surajit K Mitra

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