Retrive data base details of all tables

how can i retrive the
table name, no of rows in that table, no of indexs in that table, no of not null col's in that table
of in single data base(genuine query).

Here's a starter...
The best way to count the number of rows on a table is not to look in the data dictionaries but to actually count the rows...
Laurent Schneider
http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html
SQL> select
  2    table_name,
  3    to_number(
  4      extractvalue(
  5        xmltype(
  6 dbms_xmlgen.getxml('select count(*) c from '||table_name))
  7        ,'/ROWSET/ROW/C')) count
  8  from user_tables
  9 where iot_type != 'IOT_OVERFLOW';
TABLE_NAME                      COUNT
DEPT                                4
EMP                                14
BONUS                               0
SALGRADE                            5
Index Organized Table - Overflow Table
If such tables exist they cannot have "count(*)" done on them -
ORA-25191: cannot reference overflow table of an index-organized table Other information is in the various database dictionary views.
Edited by: BluShadow on Sep 3, 2008 12:18 PM
For some reason this new Jive forum doesn't allow "not equals" as in "<" and ">" when posted together in the code. Stupid forum.

Similar Messages

  • Help for transfering data from one user' all tables to another

    Hello guys,
    I have trim the extra sizes of columns in almost all tables of my database. Before doing this, I saved the data of tables by creating another user "User1" with the same objects and importing dmp file in it. After this I cleared my original objects and reduced the extra sizes of columns alomost in all tables.
    Now I want to transfer data from backup user "User1" into my original user's "User" tables.
    Can any one guid me with the way of doing so, so that I could do it just through 3 or 4 lines of code instead of individualy table wise transfering the data...??
    regards
    Kashif

    SQL> select 'insert into '||table_name||' as select * from user1.'||table_name ||' ;' from user_tables where table_name in ('EMP', 'DEPT') ;
    'INSERTINTO'||TABLE_NAME||'ASSELECT*FROMUSER1.'||TABLE_NAME||';'
    insert into DEPT as select * from user1.DEPT ;
    insert into EMP as select * from user1.EMP ;
    2 rows selected.
    SQL>You could spool the output of the query above to a .SQL script file and then just run it within the same script using @@script_name.SQL.

  • Unable to edit table data, but not for all tables

    I have multiple tables in a schema. For some tables, I am able make edits to table data directly, i.e., context menu Table | Open, and the Data tab. When I am able to edit, I do get a pencil icon inside the cell I am editing/typing (and am able to commit the changes). When I am not able to edit, it does nothing (no error messages, sound, or visual cue). I thought it had to do with who owns the table object, but I log in as the same owner of the affected table objects.
    Any pointers would be greatly appreciated so I am equipped when asking the DBA.
    Thanks,
    OS: Windows XP Professional SP2
    Java(TM) Platform: 1.6.0_11
    Oracle IDE: 2.1.1.64.45
    Versioning Support: 2.1.1.64.45
    Edited by: New2OWB10gR2 on Jun 23, 2010 12:20 PM

    Hello again,
    Here you are the DDL of the offending table:
    CREATE TABLE "DBADMEX"."T50SEC82"
    "COD_EMPRESA" CHAR(4 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_EMPR_CONT" CHAR(4 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_SECT_CONT" CHAR(2 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "NUM_CUEN_CONT" CHAR(18 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_PAIS" CHAR(4 BYTE) DEFAULT ' ' NOT NULL ENABLE,
    "COD_SECTOR" CHAR(6 BYTE) DEFAULT ' ' NOT NULL ENABLE
    PCTFREE 10 PCTUSED 40 INITRANS 50 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
    TABLESPACE "TS_50" ;
    CREATE UNIQUE INDEX "DBADMEX"."I5000082" ON "DBADMEX"."T50SEC82"
    "COD_EMPRESA", "COD_EMPR_CONT", "COD_SECT_CONT", "NUM_CUEN_CONT"
    PCTFREE 10 INITRANS 50 MAXTRANS 255 COMPUTE STATISTICS STORAGE
    INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
    TABLESPACE "TS_50" ;
    We are using the following versions:
    Oracle database: 11.1.0.7.0
    Oracle Client: 11.2.0.1.0
    Windows (where the client runs): XP SP3 (version 5.1 Build 2600_spsp_sp3_gdr.080814-1236) in spanish.
    SQL Developer: 2.1.1.64 (MAIN-64.45)
    I think I haven't forgotten anything.
    Thanks in advance for your help!

  • Creating MS- Access data base from the Internal tables data of an ABAP Prog

    Hi,
    I have a requirement where I have to create Access tables from the Internal tables of ABAP program.
    The tables are like Project systems Header data, WBS elements data, Netwrok data, Activity data, Milestone data and Project revunes. I will have the internal tables for these. I want to transfer these tables data into MS-Access tables onto Users desktop.
    Please adivce me how to do this.
    Thanks,
    Prabhakar

    HI,
    I am trying to create a DB table in the access but I am not successful. The following is the format of the table needs to be created from the ABAP program.
    I have created a table with the following format in MS-Access with the name tblHeader. Is it neccessary to create a DB table ( MS-Access) in advance or by using the FM  STRUCTURE_EXPORT_ TO_MSACCESS  we need to create a structure in MS-Access?
    False tblHeader
    Field Name Type Length
    ProjectDef Text 255
    ProjectDes Text 255
    Created Text 50
    Change Text 50
    RespPerson Text 255
    Profile Text 255
    Plant Text 255
    ObjNo Text 255
    OverheadKey Text 255
    I have created a Z table ZTAB1 with the same format from the SAP fields.
    MS-Access Table name : tblHeader
    ABAP program Internal table : t_tblheader
    Z table Name : ZTAB1.
    First I am trying to create a structure in MS-Access with the following FM.
    CALL FUNCTION 'STRUCTURE_EXPORT_ TO_MSACCESS'
    EXPORTING
    dbname = 'D:\test\db2'
    LANGU = SY-LANGU
    dest = 'PS_ACCESS_1'
    TABLES
    tabname = ttblheader
    EXCEPTIONS
    system_failure = 1
    comm_failure = 2
    OTHERS = 3
    Table ttblheader type is DFIES and I am filling the table with only one record and one field i.e TABNAME and the value is ZTAB1.
    The source code of the FM is using another FM
    CALL FUNCTION 'MSACCESS_STRUCT_ EXPORT_RFC' DESTINATION DEST
    Here I am getting the Error message Object required. I can't able to create a table structure in MS-Access.
    Next I am going to Use the FM
    'TABLE_EXPORT_ TO_MSACCESS'
    and it will create the records in the MS-access table.
    CALL FUNCTION 'TABLE_EXPORT_ TO_MSACCESS'
    EXPORTING
    dbname = 'D:\test\db2'
    langu = sy-langu
    dest = 'PS_ACCESS_2'
    tabname = 'ZTAB1'
    reftable = 'tblheader'
    FLG_NO_DOWNLOAD = ' '
    FLG_APPEND = ' '
    FLG_POPUP = ' '
    TABLES
    dtab = t_tblheader
    here t_tblheader is the internal table.
    Reftable = tblheader is the table which i have created in advance. ( not by using the First FM)
    In this FM i am getting a error message : Unable to connect to Database D:\test\db2.
    Please help me how to create the MS-Access database.

  • Retriving data through stored procedure returning Table of object type

    I am trying to retrieve the data returned as a table(secret_tab_type) of object type(secret_type). Now we can get the secret_tab_type table through
    rset = (ResultSet) cstmt.getObject(1); but how to map the SQL object type to Java object type ??
    FUNCTION Fetchthat(
    secretinfo      out      SECRET_TAB_TYPE,
    message     OUT varchar2
    ) return number;
    These are the declaration of secret_type object and secret_tab_type(table returned by fetchthat procedure)
    create or replace type secret_type as object
    (secret_id number(3),
    secret_question varchar2(100),
    valid_flag char);
    create or replace type secret_tab_type as table of secret_type;

    Amit,
    Your question has been previously asked (and answered) on this forum. I suggest searching this forum's archives for the terms STRUCT and ARRAY.
    For your benefit, here are the results of my search:
    http://tinyurl.com/auvl8
    Good Luck,
    Avi.

  • Retriving data from more than one table

    I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.

    926085 wrote:
    I have 6 tables with name A,B,C,D,E,F all of them have 1 column as common. I need help in developing a sql query which will give me name of table where record is present and number of its occurrences.You can check the table_name where column value is present by
    select table_name, AVG_COL_LEN from user_tab_columns where column_name='ID' and AVG_COL_LEN != 0;You'll get the results if you have all these table analyzed

  • Which Logical data base has SAP System tables (EDI)

    Hi,
    Which Logical database has SAP System tables(related to EDI-Cross application).
    Could you please any one share this your thoughts.
    Points will be rewared.
    Thanks,
    Senthil

    Hi,
    you can search with se11 - where used list - logical database
    A.

  • Fields of the data base tables

    Hi ABAP Gurus,
                     i am developing an sd module report and in that my input fields are   fkdat,
                    vbeln,
                    kunag,
                    fkart.
    and output fields are :
                       1)   vbeln
                       2)  kunag
                       3)  name1
                       4)  fkart
                       5) description of fkart
                       6)  netwr
                       7)  excise
                       8)  ecs
                       9)  schess
                       10) excise + ecs + schess = total ex received
                       11) fi doc
                       12) fi year
                       13) exnum
                       14) exdat
                       15) excbed
                       16) ecs_py
                       17) schess_py
                       18) 151617 = total ex_py
                       19) fi doc ex
                       20) fi year ex
    these fields i want in my output but can any one tell me which fields will appear in which table and the links among these tables
    i know some tables : vbrk,vbrp,konv,j_1ipart2,j_1iexchdr.
    pls help me .it's urgent .

    Hi,
    Retrive data from VBRK and VBRP Tables.
    From Billing u can find all the Values.
    Check invoice in VF03.
    KONV is for condition types .
    Based on KSCHL for condition types and kawrt for values.
    Thjese 2 fields important for getting tax values.
    Regards,
    Narasimha
    Edited by: narasimha marella on Jun 11, 2008 9:12 AM

  • Creating a Crystal Report from a non-SAP data base

    I have the following scenario
    server1\myDataBase
    server1\SAP\sapDataBases
    in sapDataBases I have about 30 company databases. I am trying to create a report, that gets informatino from a table/view/SP from server1\myDataBase, when I try to PREVIEW or SAVE such report on SAP Business One, I always get errors as
    I understand that this eerror means taht I can't invoke the data from out of SAP; it needs to be inside SAP (at least the SP, incoking some other data bases and stuff..)
    Some bodies have told me that it is beacuase I can only create a report from a table/view/sp that resides in the running/currently SAP company database. Is this right?
    Also, If this is the case, this means that If I have an SP taht I use for a crystal report, and 30 companies, I have to create such SP in the 30 companies?
    This is my software details:
    SQL Server 2012
    SAP Business One 9 PL 11
    SAP BusinessObjects Crystal Reports 2013 Support Pack 2 version 14.1.2.1121
    What I want to do is to create a non-SAP data base to create all the SPs/Views for reports, to centralize it, and the just create one reporte and do the 30-imports in each company database, without the need of creating such sps/views in each company-database. Is this possible?
    Thanks

    Moved to Integration Kit forum.
    The people in this forum will know more about the data structure than the CR Design forum which typically doesn't know much about the SAP Data sources Structure.
    Don

  • Oracle BPM 11g Engine Data base

    Hi All,
    Could you please share Oracle BPM 11g Engine data base details like tables..etc..
    Thank you.
    Regards,
    Srinivas

    Were you able to achieve this . Maybe this can help -
    Check hbuelow's reply @ Unable to see the application in BPM Workspace for Sales Quote tutorial
    Edited by: Sudipto Desmukh on May 9, 2012 7:02 PM

  • Logical data base for license revenue report.

    Hi All,
    My requirement is to create "license revenue report through SAP Query with following fields:
    VBAK:
    Sales Document,Sales Doc type,net value of sales order in document,sales org,distribution channel,division,sales office,business area,customer purchase order number,customer purchase order date,sold to party.
    VBAP:
    Sales document item,target quantity in sales units,target quantity in UOM,usage indicator,billing block for item,business area,plant(own or external),
    origin of bill of material,net price,SD document currency,material pricing pgroup,account assignment group for this material,activity type,personnel number.
    VEDA:
    contracts start date,contract end date,date on which contract is assigned.,installation date,agreement acceptance date
    VBREVK:
    clearing account for accrued revenues,clearing accountkey(offsetting account),total accrued value,currency key,amount in document currency,posting year and posting period.
    VBREVE:
    revenue amount,currency key,accrual period,company code,country of destination,profit center,posting year and posting period,amount in document currency,gl account,account for deferred revenue,account for non billed receivable
    Is there any  standard logical data base which gives all the required fields mentioned above? since i am not SD consultant i am not sure whether i have to take only above tables exactly or not
    there are certain logical databases like SD_ORDER,SD_SALES_DOCUMENT which has tables VBAK,VBAP,VEDA but i am unable to join remaining tables  VBREVE and VBREVK with those logical data bases
    Please provide some valuable suggestions on this.
    Thanks&Regards

    Hi All,
    My requirement is to create "license revenue report through SAP Query with following fields:
    VBAK:
    Sales Document,Sales Doc type,net value of sales order in document,sales org,distribution channel,division,sales office,business area,customer purchase order number,customer purchase order date,sold to party.
    VBAP:
    Sales document item,target quantity in sales units,target quantity in UOM,usage indicator,billing block for item,business area,plant(own or external),
    origin of bill of material,net price,SD document currency,material pricing pgroup,account assignment group for this material,activity type,personnel number.
    VEDA:
    contracts start date,contract end date,date on which contract is assigned.,installation date,agreement acceptance date
    VBREVK:
    clearing account for accrued revenues,clearing accountkey(offsetting account),total accrued value,currency key,amount in document currency,posting year and posting period.
    VBREVE:
    revenue amount,currency key,accrual period,company code,country of destination,profit center,posting year and posting period,amount in document currency,gl account,account for deferred revenue,account for non billed receivable
    Is there any  standard logical data base which gives all the required fields mentioned above? since i am not SD consultant i am not sure whether i have to take only above tables exactly or not
    there are certain logical databases like SD_ORDER,SD_SALES_DOCUMENT which has tables VBAK,VBAP,VEDA but i am unable to join remaining tables  VBREVE and VBREVK with those logical data bases
    Please provide some valuable suggestions on this.
    Thanks&Regards

  • Regarding Data Base Select Query

    Hi All,
              I want to extract the data from data base into my internal table
              by not giving the exact value but the pattern.
              Ex) I want to select the vendor starting with patter '12*'
                    from LFA table in my internal table.
              Which select Query I should use for getting the
              Vendor No. starting with pattern '12*' ?.
              Points will be rewaded.
              Thanks in Advance.
    With Regards
    Jitendra Gujarathi.

    Hi jitendra,
    1. simple
    2.
    select * from lfa1
    into table lfa1
    where lifnr  like '12%'.
    regards,
    amit m .

  • Dynamic change link to data base

    Hello.
    I have project with 40 pages, in each page I have SQL request , like "select * from table@dbtest". I want dynamically change link to my test data base on to real data base.
    What should I do for that would when I selecting another base, link to data base changed in all SQL requests?

    Personally, I'd rather create a synonym yourtable=yourtable@dblink, and just use 'select * from yourtable' in Apex pages. You could also create view yourtable=select * from yourtable@dblink. I usually like to have a DB link named in a meaningful way, so that I know where it's pointing just by looking at the name.
    I usually start with a local table to get Apex to read the structure, and then just replace that with a synonym or view later.
    Edited by: maceyah on Jan 12, 2012 11:38 AM

  • REPORT AND DATA BASE SETUP

    i have been using CView Manager 11 to do my reports and is relatively easy to setup reports to the data base, but not all of my reports work with this program plus there is no user manual available.  So I am trying to switch over to Chrystal Reports 11 with little success.  I can not figure out how to setup the data base server with this program.  I am trying to access the McKesson IntelliShelf Supply (Supply Scan) data base server.  Is there anyone that can help me with this?

    McKesson is an OEM partner of ours. I suggest you ask them how to.

  • How to determine the proper size for Oracle 8i Data Base Objects

    Hi,
    I'm working on an Oracle 8i Data base. I'd like to know how to determine the proper size for the Data Base objects such as tables, datafiles, tablespaces...
    Thanks.

    Start with the docs.
    http://download-west.oracle.com/docs/cd/A87860_01/doc/server.817/a76956/schema.htm#949
    Best Regards
    Krystian Zieja / mob

Maybe you are looking for

  • Display Error Message in ESS

    Dear all, I have a requirement in WEB DynPro, Our ESS system using WEB DynPro. In ESS leave system need to display error message.ie once leave approved, employees are not allowed to change the leave. Any idea to write code to display error message. T

  • HP Laserjet 4500 desktop drivers not finding scanner after install.

    First I have installed the  HP Officejet 4500 Desktop All-in-One Printer - G510a HP Officejet Full Feature Software and Driver for a HP Laserjet 4500 Desktop however after the installation has been completed and the section to where you can connect a

  • Win 8.1 upgrade

    My Twist keeps reminding me to upgrade to Windows 8.1. Has everyone done this, what was your experience? Thank you.

  • No UMTS after upgrade

    Hi, after I updated the last patch on testing (the one delivers Gnome 3.8) I've got problems with my UMTS Stick (Huawei Vodafone). Before this upgrade everything worked well, I'm searching since some hours for a solution, but may be you could help me

  • Regarding file name in the target system

    Hi.. I have got a file name releated problem in XI. I have configured a flow in XI system using proxy and after mapping process creates a output file in target machine as a "Test<Date-Time Satmp>.dat". Test is the file name and adding date-time stamp