Count of rows in a schema tables

Hi,
i wrote a script to get all the select count(*) from test; i have about 70 tables select statements spooled to a file. so far is ok but i want to see the table name in thsi so i know for what table these counts are for how to do this. urgent please.
i dont want to get from user tables since count is coming different that what actually in the table.
please help.

789287 wrote:
urgent please.Using the community discussion forums for urgent production issues is a violation of the terms and conditions.
http://www.oracle.com/html/terms.html
>
4. Use of Community Services
Community Services are provided as a convenience to users and Oracle is not obligated to provide any technical support for, or participate in, Community Services. While Community Services may include information regarding Oracle products and services, including information from Oracle employees, they are not an official customer support channel for Oracle.
You may use Community Services subject to the following: (a) Community Services may be used solely for your personal, informational, noncommercial purposes; (b) Content provided on or through Community Services may not be redistributed; and (c) personal data about other users may not be stored or collected except where expressly authorized by Oracle
>
Please log a service request with support or hire a qualified consultant.
http://www.google.com/search?q=oracle+consultant
Could also be why none of your questions seem to get answered.
Total Questions:      25 (21 unresolved)

Similar Messages

  • 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());
    }

  • How can i count no rows in my database table

    plz tell me how can i count no of rows in my database table with[b] ResultSet object

    Hi ! hope this code helps you .
    We can use the count(*) to get the total no of records in the table ad then access it through the getString method .
    import java.sql.*;
    public class JdbcTest
         public static void main(String [] args ) throws Exception
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String DBURL = "jdbc:odbc:mydsn" ;
              Connection conn = DriverManager.getConnection(DBURL);
              Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery("select count(*) from table1");
              rs.next();
              System.out.println("total rec = " + rs.getString(1));     
    Cheers !

  • Count distinct rows from an internal table

    Hi,
    i have an internal table containing pairs of entries like
    1       1
    1       2
    1       3
    2       1
    2       2
    What i want to do is to determine the value of rowcount from first column ( here it would be 2 and not 5 ) - to me it seems like a DISTINCT. Any suggestions for that ?
    Clemens

    Hi clemens,
    1. One of the ways is to use COLLECT.
    2. suppose your original internal table is ITAB.
       Create one more with just one field
        STAB eg.
    3. Loop at ITAB.
        STAB-field1 = ITAB-Field1.
        COLLECT stab.
        ENDLOOP.
    4. In stab u will have only TWO records,
        1
       2
    regards,
    amit m.

  • 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

  • Schema Table Comparison

    Hi All,
    I've got 2 schemas with identical tables.
    I want to do a minus on the tables but would like to do this with a procedure that then reports the change into a <table_name>_diff table for each - This table should show records that are in schema1 but not in 2 and records that are in schema 2 but not in 1.
    There are about 40 tables in total so a proc rather than doing it all manually would be superb...
    Any ideas ?

    Hi ,
    I have found somewhere in the net the following code......
    REM
    REM Edit the following three DEFINE statements to customize this script
    REM to suit your needs.
    REM
    REM Tables to be compared:
    DEFINE table_criteria = "table_name = table_name" -- all tables
    REM DEFINE table_criteria = "table_name != 'TEST'"
    REM DEFINE table_criteria = "table_name LIKE 'LOOKUP%' OR table_name LIKE 'C%'"
    REM Columns to be compared:
    DEFINE column_criteria = "column_name = column_name" -- all columns
    REM DEFINE column_criteria = "column_name NOT IN ('CREATED', 'MODIFIED')"
    REM DEFINE column_criteria = "column_name NOT LIKE '%_ID'"
    REM Database link to be used to access the remote schema:
    DEFINE dblink = "remote_db"
    SET SERVEROUTPUT ON SIZE 1000000
    SET VERIFY OFF
    DECLARE
      CURSOR c_tables IS
        SELECT   table_name
        FROM     user_tables
        WHERE    &table_criteria
        ORDER BY table_name;
      CURSOR c_columns (cp_table_name IN VARCHAR2) IS
        SELECT   column_name, data_type
        FROM     user_tab_columns
        WHERE    table_name = cp_table_name
        AND      &column_criteria
        ORDER BY column_id;
      TYPE t_char80array IS TABLE OF VARCHAR2(80) INDEX BY BINARY_INTEGER;
      v_column_list     VARCHAR2(32767);
      v_total_columns   INTEGER;
      v_skipped_columns INTEGER;
      v_count1          INTEGER;
      v_count2          INTEGER;
      v_rows_fetched    INTEGER;
      v_column_pieces   t_char80array;
      v_piece_count     INTEGER;
      v_pos             INTEGER;
      v_length          INTEGER;
      v_next_break      INTEGER;
      v_same_count      INTEGER := 0;
      v_diff_count      INTEGER := 0;
      v_error_count     INTEGER := 0;
      v_warning_count   INTEGER := 0;
      -- Use dbms_sql instead of native dynamic SQL so that Oracle 7 and Oracle 8
      -- folks can use this script.
      v_cursor          INTEGER := dbms_sql.open_cursor;
    BEGIN
      -- Iterate through all tables in the local database that match the
      -- specified table criteria.
      FOR r1 IN c_tables LOOP
        -- Build a list of columns that we will compare (those columns
        -- that match the specified column criteria). We will skip columns
        -- that are of a data type not supported (LOBs and LONGs).
        v_column_list := NULL;
        v_total_columns := 0;
        v_skipped_columns := 0;
        FOR r2 IN c_columns (r1.table_name) LOOP
          v_total_columns := v_total_columns + 1;
          IF r2.data_type IN ('BLOB', 'CLOB', 'NCLOB', 'LONG', 'LONG RAW') THEN
            -- The column's data type is one not supported by this script (a LOB
            -- or a LONG). We'll enclose the column name in comment delimiters in
            -- the column list so that the column is not used in the query.
            v_skipped_columns := v_skipped_columns + 1;
            IF v_column_list LIKE '%,' THEN
              v_column_list := RTRIM (v_column_list, ',') ||
                               ' /*, "' || r2.column_name || '" */,';
            ELSE
              v_column_list := v_column_list || ' /* "' || r2.column_name ||'" */ ';
            END IF;
          ELSE
            -- The column's data type is supported by this script. Add the column
            -- name to the column list for use in the data comparison query.
            v_column_list := v_column_list || '"' || r2.column_name || '",';
          END IF;
        END LOOP;
        -- Compare the data in this table only if it contains at least one column
        -- whose data type is supported by this script.
        IF v_total_columns > v_skipped_columns THEN
          -- Trim off the last comma from the column list.
          v_column_list := RTRIM (v_column_list, ',');
          BEGIN
            -- Get a count of rows in the local table missing from the remote table.
            dbms_sql.parse
            v_cursor,
            'SELECT COUNT(*) FROM (' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name || '"' ||
            ' MINUS ' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name ||'"@&dblink)',
            dbms_sql.native
            dbms_sql.define_column (v_cursor, 1, v_count1);
            v_rows_fetched := dbms_sql.execute_and_fetch (v_cursor);
            IF v_rows_fetched = 0 THEN
              RAISE NO_DATA_FOUND;
            END IF;
            dbms_sql.column_value (v_cursor, 1, v_count1);
            -- Get a count of rows in the remote table missing from the local table.
            dbms_sql.parse
            v_cursor,
            'SELECT COUNT(*) FROM (' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name ||'"@&dblink'||
            ' MINUS ' ||
            'SELECT ' || v_column_list || ' FROM "' || r1.table_name || '")',
            dbms_sql.native
            dbms_sql.define_column (v_cursor, 1, v_count2);
            v_rows_fetched := dbms_sql.execute_and_fetch (v_cursor);
            IF v_rows_fetched = 0 THEN
              RAISE NO_DATA_FOUND;
            END IF;
            dbms_sql.column_value (v_cursor, 1, v_count2);
            -- Display our findings.
            IF v_count1 = 0 AND v_count2 = 0 THEN
              -- No data discrepencies were found. Report the good news.
              dbms_output.put_line
              r1.table_name || ' - Local and remote table contain the same data'
              v_same_count := v_same_count + 1;
              IF v_skipped_columns = 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: 1 LOB or LONG column was omitted ' ||
                'from the comparison'
                v_warning_count := v_warning_count + 1;
              ELSIF v_skipped_columns > 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: ' || TO_CHAR (v_skipped_columns) ||
                ' LOB or LONG columns were omitted from the comparison'
                v_warning_count := v_warning_count + 1;
              END IF;
            ELSE
              -- There is a discrepency between the data in the local table and
              -- the remote table. First, give a count of rows missing from each.
              IF v_count1 > 0 THEN
                dbms_output.put_line
                r1.table_name || ' - ' ||
                LTRIM (TO_CHAR (v_count1, '999,999,990')) ||
                ' rows on local database missing from remote'
              END IF;
              IF v_count2 > 0 THEN
                dbms_output.put_line
                r1.table_name || ' - ' ||
                LTRIM (TO_CHAR (v_count2, '999,999,990')) ||
                ' rows on remote database missing from local'
              END IF;
              IF v_skipped_columns = 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: 1 LOB or LONG column was omitted ' ||
                'from the comparison'
                v_warning_count := v_warning_count + 1;
              ELSIF v_skipped_columns > 1 THEN
                dbms_output.put_line
                r1.table_name || ' - Warning: ' || TO_CHAR (v_skipped_columns) ||
                ' LOB or LONG columns were omitted from the comparison'
                v_warning_count := v_warning_count + 1;
              END IF;
              -- Next give the user a query they could run to see all of the
              -- differing data between the two tables. To prepare the query,
              -- first we'll break the list of columns in the table into smaller
              -- chunks, each short enough to fit on one line of a telnet window
              -- without wrapping.
              v_pos := 1;
              v_piece_count := 0;
              v_length := LENGTH (v_column_list);
              LOOP
                EXIT WHEN v_pos = v_length;
                v_piece_count := v_piece_count + 1;
                IF v_length - v_pos < 72 THEN
                  v_column_pieces(v_piece_count) := SUBSTR (v_column_list, v_pos);
                  v_pos := v_length;
                ELSE
                  v_next_break :=
                    GREATEST (INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
                                     ',"', -1),
                              INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
                                     ',/* "', -1),
                              INSTR (SUBSTR (v_column_list, 1, v_pos + 72),
                                     ' /* "', -1));
                  v_column_pieces(v_piece_count) :=
                    SUBSTR (v_column_list, v_pos, v_next_break - v_pos + 1);
                  v_pos := v_next_break + 1;
                END IF;
              END LOOP;
              dbms_output.put_line ('Use the following query to view the data ' ||
                                    'discrepencies:');
              dbms_output.put_line ('(');
              dbms_output.put_line ('SELECT ''Local'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"');
              dbms_output.put_line ('MINUS');
              dbms_output.put_line ('SELECT ''Local'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"@&dblink');
              dbms_output.put_line (') UNION ALL (');
              dbms_output.put_line ('SELECT ''Remote'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"@&dblink');
              dbms_output.put_line ('MINUS');
              dbms_output.put_line ('SELECT ''Remote'' "LOCATION",');
              FOR i IN 1..v_piece_count LOOP
                dbms_output.put_line (v_column_pieces(i));
              END LOOP;
              dbms_output.put_line ('FROM "' || r1.table_name || '"');
              dbms_output.put_line (');');
              v_diff_count := v_diff_count + 1;
            END IF;
          EXCEPTION
            WHEN OTHERS THEN
              -- An error occurred while processing this table. (Most likely it
              -- doesn't exist or has fewer columns on the remote database.)
              -- Show the error we encountered on the report.
              dbms_output.put_line (r1.table_name || ' - ' || SQLERRM);
              v_error_count := v_error_count + 1;
          END;
        END IF;
      END LOOP;
      -- Print summary information.
      dbms_output.put_line ('-------------------------------------------------');
      dbms_output.put_line
      'Tables examined: ' || TO_CHAR (v_same_count + v_diff_count + v_error_count)
      dbms_output.put_line
      'Tables with data discrepencies: ' || TO_CHAR (v_diff_count)
      IF v_warning_count > 0 THEN
        dbms_output.put_line
        'Tables with warnings: ' || TO_CHAR(v_warning_count)
      END IF;
      IF v_error_count > 0 THEN
        dbms_output.put_line
        'Tables that could not be checked due to errors: ' || TO_CHAR(v_error_count)
      END IF;
      dbms_sql.close_cursor (v_cursor);
    END;I hope , it ' ll help you...!!!!
    Regards,
    Simon

  • Counting HTML Rows

    Is there any way to count the rows in a HTML table?
    The user of the site is able to add and remove rows on the
    page and I need to be able to count the rows so I can update a
    database.
    Is it possible with some JavaScript or VBScript?
    Thanks

    Javascript:
    document.getElementById("yourTableID").rows.length
    "TGuthrie" <[email protected]> wrote in
    message
    news:ejcs0f$o35$[email protected]..
    > Is there any way to count the rows in a HTML table?
    >
    > The user of the site is able to add and remove rows on
    the page and I need
    > to
    > be able to count the rows so I can update a database.
    >
    > Is it possible with some JavaScript or VBScript?
    >
    > Thanks
    >

  • 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;

  • Count of rows from different tables.

    Hi Friends,
    I have 4 tables with a common column name "ID". I would like to get the count of rows from all the four tables which has the same ID.
    Ex
    select count(a.id) from table1 a,table2 b,table3 c,table4 d where a.id=b.id=c.id=d.id=5;
    please suggest me some solution

    may be thsi?
    select count(a.id) from table1 a,table2 b,table3 c,table4 d
    where a.id=b.id and a.id=c.id and a.id=d.id and a.id=5;

  • Count of rows of a table in header

    Hi Experts,
    I am stuck in a tricky scenario.
    I need to get the count of rows of a table in a webi report in the header of the report.
    And the count should change dynamically according to the filtering done on the table.
    For eg.
    If I have 10 countries in a table, so table has 10 rows.
    Now the count on header should show 10.
    Now if we filter the column to 5 countries, the count on the header should change to 5.
    Any Idea's.
    Regards,
    Gaurav

    Nops
    It doesn't work.
    Let me reframe my issue again:
    I dragged country object on my report.
    UK
    US
    JAPAN
    CANADA
    Now lets say in the report title, I write the formula as =Count(country)
    It will give me 4.
    Now I clicked on the column country and applied filter i.e. country = US ; UK
    Now the block shows
    UK
    US
    In the header the cell still shows 4, which I want to see as 2.
    Any ideas....?
    Thanks
    Gaurav

  • 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

  • How to get count of rows for a table?

    Hi,
    How to get count of rows for a table and secondly, how can i have access to a particular cell in a table?
    Regards,
    Devashish

    Hi Devashish,
    WdContext.node<Your_node_name>().size() will give you the no: of rows.
    This should be the node that is bound to the table's datasource property.
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value); will select the row at that particular index.
    You can access an attribute of a particular row as
    WdContext.node<Your_node_name>().get<node_name>ElementAt(index_value).get<attribute_name>();
    Hope this helps,
    Best Regards,
    Nibu.
    Message was edited by: Nibu Wilson

  • Count MySQL rows based off Value in Dynamic Table

    Greetings all. I have 2 MySQL tables; 1 that contains the names of my classes.(Class A, Class, B, etc.) and 1 table that contains the names of students in each Class (for example Class A: John Doe; Class A: Susie Smith.; Class B: Jane Doe). In the 2nd table the Class name is in its own column and the student's name is in a 2nd column.
    I currently have a dynamic repeating table that lists the names of all of the classes from the 1st table. What I'm trying to do is add a second column to this repeating dynamic table that lists the number of students in each class. For example; Row 1 of the dynamic table would say "Class A | 5; Class B | 3; Class C | 7, etc.). The dynamic table works perfectly to list the class names. For the life of me I can't figure out how to perform a count for each class to insert in the repeating table. I will be adding more Classes which as why I'm trying to set up the counting query dynamically. So far I have only been able to figure out how to count the total rows in the 2nd table, or count the rows with a specified class name. Any advice or guidance on how to count the number of rows in the 2nd MySQL table based off the class name in the repeating table is much appreciated. Thank you for any and all help. Have a great day.

    Select count(*), Class from MyTable
    Group by Class
    Time to learn about SQL:
    http://www.w3schools.com/sql/sql_intro.asp

  • COunt no of rows  of  all the tables

    hai
    Pls tell me COunt no of rows of all the tables in the user SOP
    Output like this
    Tablename rows
    sen 31
    van 45
    etc
    pls help
    S

    set serveroutput on size 100000 feedback off
    declare
    rs integer;
    cur integer;
    rp integer;
    trs integer;
    n integer;
    un varchar2(30);
    begin
    dbms_output.put_line(rpad('Table Name',40)||' Number of Rows Created Date');
    dbms_output.put_line(rpad('-',73,'-'));
    cur:= dbms_sql.open_cursor;
    for t in (select object_name, created from dba_objects where object_type='TABLE' and OWNER='SOP') loop
    dbms_sql.parse(cur,'select count(*) from SOP.' || t.object_name, dbms_sql.v7);
    dbms_sql.define_column(cur, 1, rs);
    rp:= dbms_sql.execute(cur);
    n:=dbms_sql.fetch_rows(cur);
    dbms_sql.column_value(cur, 1, rs);
    dbms_output.put_line(rpad(t.object_name,48,'.')||rpad(rs,15,'.')||t.created);
    end loop;
    dbms_sql.close_cursor(cur);
    dbms_output.put_line(rpad('-',73,'-'));
    end;
    set serveroutput off feedback on feedback 6
    Anyway or...
    set serveroutput on size 100000 feedback off
    declare
    rs integer;
    cur integer;
    rp integer;
    trs integer;
    n integer;
    un varchar2(30);
    v_user varchar2(20);
    begin
    v_user := '&user';
    dbms_output.put_line(rpad('Table Name',40)||' Number of Rows Created Date');
    dbms_output.put_line(rpad('-',73,'-'));
    cur:= dbms_sql.open_cursor;
    for t in (select object_name, created from dba_objects where object_type='TABLE' and OWNER=v_user) loop
    dbms_sql.parse(cur,'select count(*) from '|| v_user ||'.' || t.object_name, dbms_sql.v7);
    dbms_sql.define_column(cur, 1, rs);
    rp:= dbms_sql.execute(cur);
    n:=dbms_sql.fetch_rows(cur);
    dbms_sql.column_value(cur, 1, rs);
    dbms_output.put_line(rpad(t.object_name,48,'.')||rpad(rs,15,'.')||t.created);
    end loop;
    dbms_sql.close_cursor(cur);
    dbms_output.put_line(rpad('-',73,'-'));
    end;
    Enter value for user: TEST
    old 11: v_user := '&user';
    new 11: v_user := 'TEST';
    Table Name Number of Rows Created Date
    TEST_UPDATE2....................................1..............21-JAN-09
    TEST_UPDATE.....................................1..............20-JAN-09

  • The biggest count of rows of sys tables

    Hii ??
    I want to learn how can I find the biggest count of rows of sys tables or
    which table has around 900000 records on sys user database oracle 10g??

    Hello;
    What purpose would knowing the row count in tables owned by SYS serve ? The query below will give you a fair idea of row counts in tables owned by SYS assuming that statistics have been recently gathered for these tablesselect table_name,num_rows from dba_tables where owner='SYS';Varad

Maybe you are looking for

  • How to write POJO for XML file.. i do not want to use JAXB or any other tec

    How to generate POJOs for the specific xml files. Each XML file will have elements name with Type. Which in turn related to some other xml file For example student.xml <student name"mystudent"> <studentname type="firstname"/> <studentname type="first

  • In vl10d the error is delivery is open

    Hi guru's Can anybody guide while creating a delivery through vl10d, the error is see log for creating deliveries, while entering the log there are total 4 errors one for 0 material available, another is the sum of the confirmed quantity exceeds the

  • Pass a para to javascript function

    In a jsp page, a javascript function needs to get a parameter from a variable of the jsp page. How can I do this? Thanks a lot! ---a.jsp--- <SCRIPT language=JavaScript> function changeR(userID){ alert( userID + " chaged a value " ); </SCRIPT> <% user

  • Receiving calls via Skype Online Number

    I understand that I pay £10 for 3 months to set this up. I understand that callers pay for a local call (so long as they're close to that local number) I do NOT understand if I pay to receive each call and if so, how much?

  • Error message 11333 fix problems.

    I tried to download the programs for the fix but I got an error message that says, "Error loading cryptext.dll. The specific module could not be found." Anyone else get this error message?