'Count all rows' in Disco Plus?

Hi all - I can't find an option to Count All Rows in disco plus. This is something my users use all the time in Desktop - is it included in Plus?
In Desktop, it is under menu item 'Sheet'
Thanks!
Scott

Hi Scott
Sorry that was removed from Discoverer Plus so you won't find a button for it. Having that there would force Discoverer to have to run the entire query just to give you the total count. Oracle considered this a waste of resource and query effort, which I sort of agree with because I can see what they are getting at, and so removed it.
Best wishes
Michael

Similar Messages

  • No Count all Rows in Discover Plus

    Hello,
    in Discoverer Desktop it is possible to count all rows (menue: sheet|Count all Rows) for a query. In Discoverer Plus Version 9.0.4 i am missing this feature. Is there a work around for this problem?
    Franz

    Thanks Marcus,
    i know, but it is a very slow way if you are selecting 10000 records. I don't understand why Oracle is not be able do add this feature like in the Desktop to Plus.
    Franz

  • Count all rows in all tables

    Is there any easy way to count all of the rows in all of the tables?
    I am currently generating a list of tables by selecting from all_tables and then turning that into individual select count(*) statements using awk.
    I'm guessing there is probably some other better method?

    Jim,
    I have a sql script which I call numrows that will dynamically create select count(*) statements from the dba_tables dictionary view... It does not display all of the tables in the entire database, but instead prompts you for a particular schema. Maybe you can adjust to do what you want it to..
    Regards,
    David
    +++beginning of script
    -- Script to count the number of rows in tables
    set serveroutput on
    declare
    numrows integer;
    cursor c1 is select table_name from user_tables order by table_name;
    function rowcount(tablename in user_tables.table_name%type)
    return integer is
    cursornum integer;
    numrows integer;
    ignore integer;
    begin
    cursornum := dbms_sql.open_cursor;
    dbms_sql.parse(cursornum,
    'select count(*) from ' | | tablename,
    dbms_sql.v7);
    dbms_sql.define_column(cursornum, 1, numrows);
    ignore := dbms_sql.execute(cursornum);
    ignore := dbms_sql.fetch_rows(cursornum);
    dbms_sql.column_value(cursornum, 1, numrows);
    dbms_sql.close_cursor(cursornum);
    return numrows;
    end;
    begin
    dbms_output.enable(10000);
    dbms_output.put_line('Table Rows ');
    dbms_output.put_line('------------------------------ ----------');
    for c1rec in c1 loop
    numrows := rowcount(c1rec.table_name);
    dbms_output.put_line(rpad(c1rec.table_name, 32) | | numrows);
    end loop;
    end;
    null

  • Count ALL rows in databases

    Hi experts!
    I need the total number of ROWS in EACH database i have (All schema)
    I've tried this for each DB
    select sum(num_rows)
    from sys.dba_tables
    where owner like '%%'
    i obtain the number of all rows for all schema in database.
    I have many database, i use agent g10.0 and enterprice manager to query them.
    I
    've seen that in Enterprise Manager, when you select a Database Istance, then go on "administration" tab, and u click on TABLES link, you can see number of rows and last time the table was analyzed. How are they have been calculated? With table dba_tables? How can i query to obtain these values?
    I know it's a stupid task but my boss wants this info :(

    > I know it's a stupid task but my boss wants this info :(
    Tell him two gazillion. Also tell him that the gazillion scale has been specifically created for managers like him with heads firmly stuck up the back side.
    Anyway, here's some sample code. Note that you cannot use DBA_TABLES view. Object tables are not listed in there and they can contain rows (obviously). There is also the case of dealing with case and "weirdly" names tables - thus double quotes are needed.
    I only did the first 10 tables.. It is stupid to just one, never mind all of them in database...
    SQL> declare
    2 type TStrings is table of varchar2(1000);
    3
    4 cursor c is
    5 select '"'||owner||'"."'||object_name||'"' as TAB_NAME from dba_objects where object_type='TABLE' and rownum < 11 order by 1;
    6
    7 tabList TStrings;
    8 sqlSelect varchar2(1000);
    9 cnt integer;
    10 total integer;
    11
    12 procedure W( line varchar2 ) is
    13 begin
    14 DBMS_OUTPUT.put_line( line );
    15 end;
    16 begin
    17 total := 0;
    18 open c;
    19 loop
    20 fetch c bulk collect into tabList limit 100;
    21 for i in 1..tabList.Count
    22 loop
    23 sqlSelect := 'select count(*) from '||tabList(i);
    24 begin
    25 execute immediate sqlSelect into cnt;
    26 total := total + cnt;
    27 W( sqlSelect || ' ' || cnt || ' rows(s)' );
    28 exception when OTHERS then
    29 W( sqlSelect || ' ' || sqlerrm(sqlcode) );
    30 end;
    31 end loop;
    32 exit when c%NOTFOUND;
    33 end loop;
    34 close c;
    35 W( total|| ' gazillion rows in the database' );
    36 end;
    37 /
    select count(*) from "SYS"."CLU$" 10 rows(s)
    select count(*) from "SYS"."COL$" 43696 rows(s)
    select count(*) from "SYS"."CON$" 2898 rows(s)
    select count(*) from "SYS"."FILE$" 5 rows(s)
    select count(*) from "SYS"."ICOL$" 2184 rows(s)
    select count(*) from "SYS"."IND$" 1434 rows(s)
    select count(*) from "SYS"."PROXY_ROLE_DATA$" 0 rows(s)
    select count(*) from "SYS"."SEG$" 3032 rows(s)
    select count(*) from "SYS"."UET$" 0 rows(s)
    select count(*) from "SYS"."UNDO$" 11 rows(s)
    53270 gazillion rows in the database
    PL/SQL procedure successfully completed.
    SQL> PS. Cursor needs fine tuning as certain table objects cannot be directly accessed via a SELECT statement (e.g. nested tables, overflow IOT tables, etc).

  • Count all rows of a Database table

    I want to count all the rows of a table.
    I have made correctly the connection with the database and all the other things (make a statement, make the query and the resultSet), I use the MySQL server v4.0.17
    Here is the code I use:
    int count=0;
    String temp=null;
    String query = "SELECT COUNT(*) FROM customers";//customers is my Database Table
    try {
    rs = stmt.executeQuery(query);
    }//end try
    catch(Exception exc) {
    createFeatures.PlayErrorSound(registerRenter);
    Optionpane.showMessageDialog(registerRenter,
    "MESSAGE", "ERROR", JOptionPane.ERROR_MESSAGE);
    }//end catch
    try {
    while(rs.next()) {
    count++; //I use this variable in order to count the rows because the resultSet doesn't tell me the answer
    countLine=rs.getInt(1);
    }//end while
    }//end try
    catch(Exception exc) {
    createFeatures.PlayErrorSound(registerRenter);
    Optionpane.showMessageDialog(registerRenter,
    "MESSAGE", "ERROR", JOptionPane.ERROR_MESSAGE);
    }//end catch
    count=count++; //i increase it aggain because if the rows are initial 0 i want to make it 1
    temp = String.valueOf(count);//i use this command in order to display the result into a jtextfield
    Any help is appreciated!!!!!

    This program will work just fine against mysql:
    mport java.util.*;
    import java.io.*;
    import java.sql.*;
    public class Test {
    public static void main(String []args) {
    String url= "jdbc:mysql://localhost/adatabase";
    String query = "select count(*) from foo2";
    String createQuery="create table foo2(f1 int)";
    String dropQuery="drop table foo2";
    String insertQuery="insert into foo2 values(1)";
    Properties props = new Properties();
    props.put("user", "auser");
    props.put("password", "xxxxx");
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    System.out.println("Connecting to the msql server");
    Connection con = DriverManager.getConnection(url, props);
    Statement stmt = con.createStatement();
    try {
    stmt.executeUpdate(dropQuery);
    } catch(SQLException e) {}
    stmt.executeUpdate(createQuery);
    stmt.executeUpdate(insertQuery);
    stmt.executeUpdate(insertQuery);
    PreparedStatement pstmt = con.prepareStatement(query);
    System.out.println("***Executing a select");
    ResultSet rs = pstmt.executeQuery();
    while (rs.next()) {
    System.out.println("RowCount="+ rs.getString(1));
    rs.close();
    pstmt.close();
    stmt.close();
    con.close();
    } catch(Exception e) {
    System.out.println(e.getMessage());
    }

  • Count all rows in user_tables

    Hi,
    Any one could help me to write a pl/sql procedure to get the total number of all the rows of user_tables?
    Thanks!

    Have a look at the following thread:
    'count rows of all rows of all tables urgent'
    count rows of all rows of all tables urgent

  • Retrieve All Rows in Disocverer Plus

    Hi,
    Can we set the 'Retrieve All Rows' option in Discoverer Plus ?
    I can go to Tools > Retrieve All Rows. But is there any way (like a checkbox) we can set it permanantly so that every user need not to look into it ?
    Thanks!
    Yogini

    Hi,
    As a workaround, I changed the value for :
    Tools > options > Query Governor >
    Retrieve Data incrementally in groups of = 10000 (This is the max value ).
    But it didnt work.
    It retrieves first 250 rows (by default) and then it says 'Click to retrieve next 10000 rows'..its not what I want.
    Any Suggestions?
    Yogini

  • Calculating a count of rows where value matches another column value in the same table

    Hi,
    I'm struggling to do something in DAX that seems to me should be super easy (coming from a SQL world)!
    That is to count all rows in column 1 where the value matches the current value for column 1?
    E.g something like this:
    [Col2]=Count of rows in [Col1] where value = this.[Col1]
    Where the results are as in the table below:
    Col1, Col2
    A, 2
    A, 2
    B, 1
    Anyone?
    Martin Laukkanen
    Nearbaseline blog - nearbaseline.com/blog
    Bulk Edit and other Apps - nearbaseline.com/apps

    Thanks, that's perfect! 
    I knew it had to be something so simple, but after spending over an hour banging my head against those exact functions I couldn't get anything working!
    Martin Laukkanen
    Nearbaseline blog - nearbaseline.com/blog
    Bulk Edit and other Apps - nearbaseline.com/apps

  • Present a total count of rows

    I'd like to present a total count of rows in the bottom of a report.
    how would you recommand me to do it???
    the point is that it must be presented in each report so i thought to add some HTML code to "After Rows" section in the report template. but i need a variable (or some substitution string) which will contain the total count. but how do i define a substitution string?

    as i mentioned i need to present a total count in the buttom of each report in my application. therefore I think it's reasonable to add a code in the report template, which present some variable which count all rows in a report.
    #TOTAL_ROWS# doesn't work if i place it on the template html code, though it works fine if i place it in the report region definition:
    <br><b>Total Number of Results:</b> #TOTAL_ROWS#.</br>
    why can't i use #TOTAL_ROWS# as a template variable? and how can i do that?

  • View all rows

    Hi,
    I want to view all rows of a workbook in Discoverer Desktop but I can't. I have a worksheet where I can view 10000 rows. But when I select Sheet --> Count all rows the answer is 83165.
    How can I view the rest of rows? I have the Sheet --> View all rows option disabled.
    Thanks.

    Hi there,
    Look at Tools-->Options-->Query Governor. The "Limit retrieved date to" is set to 10,000. Change as required or de-select the option.
    Regards,
    John

  • Procudure to count all the rows in a all tables in the schema

    When I run the following store procedure to count all the rows in all the tables I crash my sql Plus editor:
    CREATE OR REPLACE PROCEDURE TC_TABLEROWCOUNT(OWNER IN varchar2)
    IS
    row_count number;
    cursor get_tab is
    select table_name, num_rows
    from all_tables
    where owner='MAXDEV';
    begin
    dbms_output.put_line('Checking Record Counts for schema maxdev ');
    FOR get_tab_rec IN get_tab LOOP
         BEGIN
              EXECUTE IMMEDIATE 'select count(*) from '||get_tab_rec.table_name
              INTO row_count;
              EXCEPTION WHEN OTHERS THEN
                        dbms_output.put_line('Error counting rows for table '
                                                 ||get_tab_rec.table_name);
         END;
    END LOOP;
    END;
    What am I doing wrong.
    Thanks for any help Tony

    The boss gave me 5 pages of tables and wants to know how many row there are in each table. There is a problem of one DB being out of sync with another.
    But I have managed to work the problem though.
    here is the working code:
    CREATE OR REPLACE PROCEDURE TC_TABLEROWCOUNT (
    TableOwner IN varchar2)
    IS
    row_count number;
    vTable varchar2(30);
    v_sqlstmt varchar2(100);
    cursor get_tab is
    select table_name, num_rows
    from all_tables
    where owner = TableOwner;
    begin
    dbms_output.put_line('Checking Record Counts for schema maxdev ');
    FOR get_tab_rec IN get_tab LOOP
    vTable := get_tab_rec.table_name;
    v_sqlstmt := 'SELECT count(*) from '||vTable;
    EXECUTE IMMEDIATE v_sqlstmt into row_count;
    dbms_output.put_line('Table '|| get_tab_rec.table_name || ' Row ' || row_count);
    END LOOP;
    END;

  • Query to return ALL rows even those with zero counts

    Hi,
    The following query will return only those rows that have a non zero count value:
    select c.id, a.name, count(*) as XYZ from CON c, CUST a
    where c.help !='1' and (c.id = a.id) group by c.id, a.name order by c.id;
    The results are:
    1 ME 3
    3 YOU 4
    What i want is to return all rows in CUST and the count, XYZ, that correspond to each row in CUST that matches the whare condition above, even if the count is zero.
    ie
    1 ME 3
    2 WE 0
    3 YOU 4
    Can this be done?

    You may want to get the counts then do the outer join. If you simply count with an outer join you will get 1 for 'WE' because there is a row in the cust table with 'WE'. This may work for you;
    with
      cust as (
       select 1 id, 'ME' name from dual union all
       select 2 id, 'YOU' name from dual union all
       select 3 id, 'WE' name from dual),
      con as (
       select 1 id, '2' help from dual union all
       select 1 id, '2' help from dual union all
       select 1 id, '2' help from dual union all
       select 2 id, '2' help from dual union all
       select 2 id, '2' help from dual union all
       select 2 id, '2' help from dual union all
       select 2 id, '2' help from dual)
    -- end of test data 
    select a.id, a.name, nvl(c.cnt,0) xyz
    from cust a, 
       (select id, help, count(*) cnt
       from con
       where help !='1'
       group by id, help) c
    where a.id = c.id(+)

  • Need Query to that generate count of rows of all tables

    Hi
    i need a query which gives the result of no.of rows in talbe and coresponding table name.
    And then i need to compare the same with other DB schema
    Thanks in advance

    Hi User,
    We can also get the count of rows for all the tables associated with a User, we can create a custom function which
    uses the table name to return results.
      CREATE OR REPLACE FUNCTION TAB_ROWS_CNT (TAB_NAME IN VARCHAR2)
       RETURN NUMBER
    AS
       TAB_CNT   NUMBER :=0;
    BEGIN
       EXECUTE IMMEDIATE 'select count(*) from ' || TAB_NAME
          INTO TAB_CNT;
       RETURN TAB_CNT;
    END;And query,
    SELECT TABLE_NAME, TAB_ROWS_CNT (TABLE_NAME) ROW_CNT
      FROM USER_TABLES;Which gets us the count of Individual Tables for a user.
    This is an just that we can do in this way also. But, use which is optimal.
    Thanks,
    Shankar

  • Query Results: Retrieve All Rows?

    I was looking for a feature that will allow me to choose to return "all records" to the Query Results window. The current behavior is to fetch 50 records at a time (e.g. fetch 50 records as you scroll through the results = s-l-o-w). What I'd like to do is "Retrieve All Rows" then use to the scroll bar to "smoothly" scroll to the last record. For example, the 8.0.6 version of Query Builder had this functionality and in SQL Developer 3.0, if I right-click on the results. I can choose to "Count Rows...", seems like this would be a perfect place to put a "Retrieve All Rows" option.

    Hi,
    My advice: do something only if there is a business case for it; satisfying your curiosity can get surprisingly expensive.
    You have already read about using Run Statement to execute a SQL statement, then Ctrl-End to auto-scroll to the end. You can try the same for Run Script, but first you will probably need to increase the value of Tools|Preferences|Database|Worksheet|Max rows to print in a script. Of course, taking either of these approaches slows things down due to displaying output and scrolling. Same with SQL*Plus. And, as mentioned previously, Java memory management in SQL Developer can cause slow downs and hangs if the result set is large enough.
    Here is a way to minimize that delay, avoid hangs, and get a more repeatable result:
    1) Save some query to, say, C:\Temp\AllCustomers.sql. For example, "select * from customers;" or "select id from customers;".
    2) Run it from a SQL Developer worksheet using Run Script (F5), or from the SQL*Plus command line, with a script like this:
    set timing on
    set termout off
    spool C:\Temp\AllCustomers.lst
    @C:\Temp\AllCustomers.sql
    spool offEven then you will see that the timing results will vary. Maybe "select *" runs much slower than "select id" because the logical output lines are long and get wrapped into multiple physical output lines in the file. Minimize that by setting linesize to a longer value (but only in SQL*Plus -- it isn't supported in SQL Developer) and repeat the test to see. Maybe SQL*Plus runs it much faster than SQL Developer because one is a command line environment and the other a GUI tool with more overhead. Or maybe the SQL Developer JVM is near its size limit and lots of Java garbage collection is slowing it down. Simple question, complicated answer.
    Regards,
    Gary
    SQL Developer Team
    P.S.: And if by chance you are using a version of SQL Developer so old it does not include the output time in the query result tab's toolbar, using Run Script with set timing on is your only recourse.
    Edited by: gggraham on Oct 27, 2011 4:54 PM

  • How to get  all rows of an attribute data from a table?

    Hello.. I´m using Jdev 10.1.3.2
    I have a table with 5 columns and N rows.
    I need to create a backing bean method to count the value of all rows of a specifc column.
    I use
    JUCtrlValueBindingRef selectedRowData= (JUCtrlValueBindingRef)myTable().getSelectedRowData();
    to get an attribute from a selected row. but How can get from all rows?
    Thank you
    Vandré

    Hi Vandré
    I think this example of Steve Muench will help you.
    "Recalc Sum of Salary at the View Object Level
    This example illustrates a technique where a transient attribute of a view object is updated to reflect the total sum of some attribute of all the rows in the view object's default row set. The code to recalculate the sum of the salary is in the getSumOfSal() method in the EmpViewImpl.java class. The custom EmpViewRowImpl.java class for the view row implements the getter method for the SumOfSal attribute by delegating to this view object method. The EmpViewImpl class extends a base DeclarativeRecalculatingViewObjectImpl class that contains some generic code to enable declaratively indicating that one attribute's change should recalculate one or more other attributes. The EmpView defines the "Recalc_Sal" property to leverage this mechanism to recalculate the "SumOfSal" attribute. If you restrict the VO's results using the BC Tester tool, you'll see the sum of the salaries reflects the subset. If you add a new row or delete an existing row, the sum of sal is updated, too."
    http://otn.oracle.com/products/jdev/tips/muench/recalctotalvo/RecalcTotalOfRowsInVO.zip
    Good Luck

Maybe you are looking for

  • Default file name for BEx report

    Hi all, Wishing u a very diwali... I have one requirement from user that i should get the file name default as a technical name of the query. As of now when i open the file it is taking some random book1, book2 etc. Please suggest solution amit shety

  • ITunes music wont play

    I just restored my computer from a crash, and luckily, was able to reload my itunes library from a norton 360 encrypted back-up. However none of the MP4 files will play on the new itunes 10 version. Anyone else had this problem? please advise.

  • User after the save of customer Master

    Hi, I am working on the SAP 4.6C. I am creating the customers in the XD01. I would like to trigger an exit after the save of the customer Doc to create hierarchy. This is required as the FM to create the hierarchy needs the customer number. Could any

  • [CS2 JS]Script UI Help !!!

    Hi, I want to create a dialog using Script UI . But i dont know where ro start with.Please tell the scripting reference. I found some sample in this forum which i tried is given below: var w = new Window( "dialog", "Example" ); But when i run the scr

  • Alias names

    What is alias names for columns and tables in joins. Is alias related to speed of retrieval process.If yes how ?. If not, then what is the purpose of alias. Can u suggest me a solution.