All columns of all table in one schema

Hi
All,
Oralce 10.2.0.3
I want to count all columns in all the table in one particular schema.
How can I do that?
which view i should use to count all cloumns of all tables in particular schema?
Thanks

vishal patel wrote:
we needed for our data conversion project..I don't know how you'll use the number of columns in all a schema for data conversion. Some columns are duplicated (e.g. PK/FK), should they really count for two ?
A data conversion means you should actually know what are the columns used for, not how many they are.
one more question that count include hidden columns
what is hidden column used for ? I can not see those columns in actual table.See here an example :
Re: Difference btwn user_tab_cols & user_tab_columns
Nicolas.

Similar Messages

  • Aggregate of all Columns in each table for the entire schema

    I want to calculate the report of Aggregate of all Columns in each table for the entire schema in Oracle. Pls let me know which approach is best to do this.
    Thanks in advance !!

    Not sure about your requirement..
    This?
    select table_name,sum(data_length) sm
    from user_tab_cols
    group by table_name;                                                                                                                                                                                                                                                                           

  • How to search all columns of all tables in a database

    i need to search all columns of all tables in a database , i already write the code below , but i've got the error message below when run this script
    DECLARE
    cnt number;
    v_data VARCHAR2(20);
    BEGIN
    v_data :='5C4CA98EAC4C';
    FOR t1 IN (SELECT table_name, column_name FROM all_tab_cols where owner='admin' and DATA_TYPE='VARCHAR2') LOOP
    EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' ||t1.table_name|| ' WHERE ' ||t1.column_name || ' = :1' INTO cnt USING v_data;
    IF cnt > 0 THEN
    dbms_output.put_line( t1.table_name ||' '||t1.column_name||' '||cnt );
    END IF;
    END LOOP;
    END;
    Error report:
    ORA-00933: SQL command not properly ended
    ORA-06512: at line 7
    00933. 00000 - "SQL command not properly ended"
    *Cause:   
    *Action:
    Any help please

    SQL solutions by Michaels
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    11g upwards
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from (select column_name,
                   table_name,
                   'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
              from cols
             where table_name in ('EMP', 'DEPT')),
           xmltable (str columns result varchar2(10) path '.')
    TABLE_NAME                     COLUMN_NAME                    SEARCH_STRING                    RESULT   
    DEPT                           DNAME                          es                               RESEARCH 
    EMP                            ENAME                          es                               JAMES    
    EMP                            JOB                            es                               SALESMAN 
    EMP                            JOB                            es                               SALESMAN 
    4 rows selected.

  • ORA-12983: cannot drop all columns in a table

    Hi,
    I am creating a table with two columns.
    I have modified a column as unused using ALTER statement.
    After that i have tried to drop the another column by using ALTER statement.
    But it throws an error ORA-12983: cannot drop all columns in a table.
    is it not possible to achieve this via ALTER statement?
    thanks

    is there any other way to find the name of the columns which have been marked as unused?Don't think so, and you would not be able to do much about. You won't be able to reference it, you won't be able to un-unuse it, and you would even be able to add a new column having same name.
    Why are you using SET UNUSED in the first place?
    Regards
    Peter
    Quoting myself:
    You won't be able to reference itMaybe not good enough:
    SQL> select column_name, data_type, segment_column_id
      from user_tab_cols
    where table_name = 'T';
    COLUMN_NAME                    DATA_TYPE   SEGMENT_COLUMN_ID
    SYS_C00001_11051618:28:14$     NUMBER                      1
    B                              NUMBER                      2
    SYS_C00003_11051618:28:14$     NUMBER                      3
    3 rows selected.
    select "SYS_C00003_11051618:28:14$" from t
    Error at line 1
    ORA-00904: "SYS_C00003_11051618:28:14$": invalid identifier
    SQL> alter table t drop column "SYS_C00001_11051618:28:14$";
    Table altered.
    SQL> select column_name, data_type, segment_column_id
      from user_tab_cols
    where table_name = 'T';
    COLUMN_NAME                    DATA_TYPE   SEGMENT_COLUMN_ID
    B                              NUMBER                      
    1 row selected.
    Note: Both columns "disappeared"  Thanks MichaelS
    Edited by: Peter on May 16, 2011 9:29 AM

  • How can we copy table from one schema to other schema

    Hi,
    I have create one table in one schema and i want to copy it to other schema.How we can copy table from one schema to other schema

    Hi,
    You can try something like this :-
    SQL> CONNECT SYS/SYS123@SERVER AS SYSDBA
    Connected.
    SQL> CREATE USER TEST_1 IDENTIFIED BY TEST_1;
    User created.
    SQL> CREATE USER TEST_2 IDENTIFIED BY TEST_2;
    User created.
    SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_1;
    Grant succeeded.
    SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_2;
    Grant succeeded.
    SQL> CONNECT TEST_1/TEST_1@SERVER
    Connected.
    SQL> CREATE TABLE TEST_COPY ( TEST_COL NUMBER );
    Table created.
    SQL> INSERT INTO TEST_COPY VALUES ( 1 );
    1 row created.
    SQL> INSERT INTO TEST_COPY VALUES ( 2 );
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> GRANT ALL ON TEST_COPY TO TEST_2;
    Grant succeeded.
    SQL>  CONNECT TEST_2/TEST_2@SERVER
    Connected.
    SQL> CREATE TABLE TEST_COPY AS SELECT * FROM TEST_1.TEST_COPY;
    Table created.
    SQL>  SELECT * FROM TEST_COPY;
      TEST_COL
             1
             2Regards,
    Sandeep

  • How do I move a table from one schema to another schema on Oracle XE?

    How do I move a table from one schema to another schema on Oracle XE?

    Hi,
    I tried to use the insert/select statement that you had given, it did not work.
    The error is ORA-00913: too many values.
    But finally what I did was, I went into the system schema where the table was and generated the DDL through the utilities and afterwards I imported them into the schema that I am currently working on. It solved the problem!
    However I am still curious to know why the insert/select statement did not work? Do you know any site/tutorial which gives a real time example?
    Thank you
    Skye

  • How do I move a table from one schema to another schema?

    How do I move a table from one schema to another schema?

    Grant access to the table from the source schema to destination schema.
      GRANT SELECT ON <TABLE_NAME> TO  <DESTINATION SCHEMA>A simple way would be to use CREATE Table with select syntax (in destination schema)
      CREATE TABLE <TABLE_NAME> AS SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME><li>However, you would be in <b><u>trouble when the table has index,constraints and triggers</u></b>.
    So you can better of grab the DDL statement of the table(and any additional components) andd then create the table in the destination schema.You can use SQL developer, Toad or Apex's Object browser for this.
    After the table is created, Insert the records using SELECT.
    INSERT INTO <TABLE_NAME> SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME>This question is discussed in great detail in this <b>AskTom thread</b>

  • How Can I obtain the tables of one schema and the record size???

    How Can I obtain the tables of one schema and the record size???
    Example:
    TableName Record Size
    Tabla1 12500
    Tabla2 7800
    Tabla3 2046

    This is not an OWB question, but you can obtain bda-type information on tables by using the system view dba_tables.
    Regards:
    Igor

  • All columns of trinidad table are not coming up on page while its running

    Hi,
    I have put two trinidad tables on my page.But while the page is run, I am unable to see all the columns of the table.Only a few columns are visible.
    Also, though there are 5 rows in teh table ,there is a lot of gap below the tablespace.So the next table comes after a very big gap.
    How to solve the above two problems? Kindly let me know your valuable suggestions.
    Regards

    Hi santosh,
    Following is my code.I am providing only one column code(similarly there are 3 more columns),along with the table code.
    <tr:table value="#{phonebeannew.inputphone}" var="row"
    rows="#{bindings.phone.rangeSize}"
    inlineStyle="height:#{phonebeannew.rownumbers + 275}px"
    id="t1" width="100%">
    <tr:column sortProperty="phonetype" sortable="false"
    headerText="phonetype"
    id="c3" width="5px">
    <tr:inputText value="#{row.phonetype}"
    simple="true">
    I gave width as 5px but it doesnt make any difference in output.
    The 'phonebeannew' is our bean and inputphone is a property of it.input phone holds the array of values for the 4 columns.
    Kindly let me know if you want any further information which I can provide
    Regards

  • How to search all columns of all tables in a database for a keyword?

    Dear Team,
    i have an requirement that : i want to search all the columns of all the tables in the particular database based on the specific key word or an free text.
    example :
    table 1: columns data
    empname sam
    empid 01
    table 2 columns data
    deptname sam
    departmentid 10
    table 3 columns data
    organization name sam
    organization id 1
    when i search for text " SAM"
    it should search me from the entire database, all tables and columns of it and display the result
    output : tablename cloumn value
    table1 empname sam
    table2 deptname sam
    table3 organizationame sam
    the example is just an sample not the real data .
    please help me with sample code or any link related to it .
    thanks in advance

    Hi justin , thanx for the reply
    the basic requirement that we required is ,
    the user will just type the keyword( value in the coumn) he required and it should search all the tables and columns of the table in the database and i have to show this in the front ent in the table format. here the user will analyse the information based on the search .
    it is just like the google search we does( type the keyword in free text) it will display the result.
    so for that i have to search entire table and columns in the whole database.
    please if any one provides me the solution it will be help full for me.
    thanx in advance

  • File Browse Option don't show me all Column in Data / Table Mapping

    Dear Friends,
    i am using 4.1 on APEX.ORACLE.COM.
    i have to created page with DATA Upload option.Page are ctreated successfully But there is one problem when i COPY & PASTE DATA from Excel Sheet then Data Upload Success fully.
    But When I use File Browser Option to Upload Data Then In Data / Table Mapping Step that show me Only One Column Name Select list with Do Not Load default option . but i have 7 column name in Excel Sheet. that should be display me 7 Select List to select All column name which are mention in Excel Sheet
    Please tell me where i am wrong and how to display all Column name in Data / Table Mapping step to upload Excel Sheet Data.
    How to Resplve this issue.
    Thanks
    Manoj Kauhsik

    Dear Earl,
    Thanks to reply me.
    I am not using Utility to upl;oad Excel Sheet Data.
    i am go through Apex.oracle.com .i have create an application to upload data from Excel Sheet.
    There is an option DATA UPLOAD when we create new Page so i have choose this option and create Pages with follow all instraction .By using this option i want to an Feature in my Application to Upload Data .
    When i use Copy and Paste OPtion to upload data from Excel Sheet.then Data ar Uploaded but Problem Is When i use File Browser Option to upload data then that show me only one option for Column name rather than i have 7 Column in My excel file.
    i have one more problem ,i have .csv file when i open it and close then no problem but when i reopen it then that show me a pop up with Meassages
    "Excel has detected abc.csv file is a SYLK file.but can't load it".
    How resole it.Please suggest me.
    Thanks
    Vedant

  • Is there a way to match all columns in a table?

    Oracle 11.1.0.7:
    Is there any way to say match all the columns of Table A with Table B? For eg:
    Table A
    id
    name
    Table B
    id
    name
    Is there a way to say match all the columns with similar column in other in a select instead of doing "where A.id = B.id and A.name = b.name"? I am trying to write a compare script to test that replication is indeed doing the right thing.

    user628400 wrote:
    If 2 columns have null values does it match that too? I'll run some tests.It does
    SQL> ed
    Wrote file afiedt.buf
      1  with a as (select 1 col1, null col2 from dual
      2             union all
      3             select 2 col1, null col2 from dual
      4             union all
      5             select null, null from dual),
      6       b as (select 1, null from dual
      7             union all
      8             select null, null from dual)
      9  select *
    10    from a
    11  minus
    12  select *
    13*   from b
    SQL> /
          COL1 C
             2
    While I was doing the comparision I found that if column x in Table A has "null" and same column x in table B has "null" and if I do "where A.x = B.x" then it doesn't return the row. I am not sure why. Does "minus" work the same way?That's because NULL will never equal any value (including NULL) and NULL will never not equal any value (including NULL). That is
    NULL = 1 is unknown (which maps to false)
    NULL = NULL is unknown
    NULL != 1 is unknown
    NULL != NULL is unknown
    If you want to compare columns that may have NULL values, you need to use IS NULL and IS NOT NULL or use the NVL function to map NULL values to a non-NULL but impossible value, i.e.
    WHERE (a.x = b.x OR
            (a.x is null and b.x is null))or
    WHERE nvl(a.x,-17) = nvl(b.x,-17)assuming that -17 is not a valid value for either a.x or b.x
    Justin

  • Logging ALL Columns in a Table

    Hi I want to enable supplemental logging for all columns in table. So I issued the command
    'ALTER TABLE xxxx ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS:
    Now In that table I have 5 LOB colums,2 CLOBS and 2 Varchar2 columns and I dont want to log them but all the other columns.How to do this.Will logging all columns automatically reject LOBs and CLOBS???

    Use the following code for remove all the row in a table...
    call the DeviceClearTable()
    method in mouse event...
    public void DeviceClearTable()
         int numrows = DeviceModel.getRowCount();
              for(int i = numrows - 1; i >=0; i--)
                   DeviceModel.removeRow(i);
    Edited by: kumaravel on Jun 2, 2008 10:36 AM

  • Remove all columns in a table

    whenever a user decides to choose another file to read, i would remove all the columns in the table and then write it all over again, However, I do not see such function in jtable, so how do I go about doing that?

    Use the following code for remove all the row in a table...
    call the DeviceClearTable()
    method in mouse event...
    public void DeviceClearTable()
         int numrows = DeviceModel.getRowCount();
              for(int i = numrows - 1; i >=0; i--)
                   DeviceModel.removeRow(i);
    Edited by: kumaravel on Jun 2, 2008 10:36 AM

  • Possible to include all columns of a table in a SELECT but exclude BLOBS?

    Hi
    I am using Oracle 9i.
    I was hoping the following would give me a list of rows in 1 table on a schema that are not in another identical table on another schema:
    select * from online.table minus select * from offline.table
    However, the statement issues the error:
    ORA-00932: inconsistent datatypes: expected - got BLOB
    Without writing a contruct query to get the columns (excluding BLOBS etc) is there another,easier way?
    Thanks
    Edited by: cubmar on May 25, 2009 2:41 PM

    Hi,
    No need to write PL/SQL(?). Just generate the select lists needed, by using the dictionary.
      select column_name || ','
        from user_tab_cols
       where data_type not in ('BLOB', 'CLOB', 'LONG')
         and table_name = upper('&your_table')
    order by column_id;Regards
    Peter

Maybe you are looking for