Get double return for join table

Dear Experts:
SELECT eban~banfn      "PR number
         eban~bnfpo      "PR item
         eban~bsart      "Doc Type
         eban~bednr      "Requistion tracking number
         eban~ebeln
         eban~ebelp
         eban~zzloc      "GEO code
         ztmm_ccp~zzclli "zzclli code
  INTO CORRESPONDING FIELDS OF TABLE gi_pr_extract
  FROM  ( eban
         INNER JOIN ztmm_ccp
                ON  eban~bednr = ztmm_ccp~bednr
               AND  eban~ebeln = ztmm_ccp~ebeln
               AND  eban~ebelp = ztmm_ccp~ebelp )
  WHERE eban~bsart IN s_bsart.  "11 input doc type
The s_bsart are:
NB
UB
ZNB
ZSC
ZUC
ZVC
ZXC
ZZO
ZZX
ZZY
ZZZ
From above SQL, I got double returen for each  ebanbanfn  and ebanbnfpo
Row     BANFN     BNFPO     BSART     BEDNR     ZZLOC     ZZCLLI
1      3100000056     00010     NB               
2      3100000056     00010     NB               CLLICD DRTP
3      3100000057     00010     NB               
4      3100000057     00010     NB               CLLICD DRTP
5      3100000058     00010     NB               
6      3100000058     00010     NB               CLLICD DRTP
7      3100000061     00010     NB               
8      3100000061     00010     NB               CLLICD DRTP
9      3100000062     00010     NB               
10      3100000062     00010     NB               CLLICD DRTP
Do you know why and how do I get the unique one?
Thank you very much!
Helen
Edited by: Thomas Zloch on Oct 4, 2010 3:49 PM - please use code tags

Hi Helen,
Please check with the below code snippet. Hope it will work.
SELECT eban~banfn     
          eban~bnfpo    
          eban~bsart     
          eban~bednr    
          eban~ebeln
          eban~ebelp
          eban~zzloc     
          ztmm_ccp~zzclli
   INTO CORRESPONDING FIELDS OF TABLE gi_pr_extract
   FROM  eban
          INNER JOIN ztmm_ccp
                  ON    ztmm_ccp~bednr = eban~bednr
                AND  ztmm_ccp~ebeln = eban~ebeln
                AND  ztmm_ccp~ebelp = eban~ebelp
   WHERE eban~bsart IN s_bsart.
Thanks
Nitesh

Similar Messages

  • Creating view to get first row for each table !!

    I am having tables(more than 10) which are related using foreign key and primary key relationship.
    Example:
    Table1:
    T1Prim T1Col1 T1Col2
    Table2
    T2For T2Prim T2Col1 T2Col2 T2Col3
    (here T2For will have value same as T1Prim and in my design it has same column name i.e. T1Prim)
    Table3
    T3For T3Prim T3Col1 T3Col2 T3Col3
    (here T3For will have value same as T2Prim)
    and so on.
    The data in the tables is like For table1 there will be one record, for table2 there will be one record and for table 3 there are more than one records.
    Can i view either the first record for each of them or all records from each of them by writing the following view.
    I have written a view like this:
    Create or replace view test (T1Prim,T1Col1, T1Col2,T2Prim,T2Col1 T2Col2, T2Col3, T3Prim,T3Col1, T3Col2, T3Col3)
    As
    Select
    Table1.T1Prim,
    Table1.T1Col1,
    Table1.T1Col2,
    Table2.T2Prim,
    Table2.T2Col1,
    Table2.T2Col2,
    Table2.T2Col3,
    Table3.T3Prim,
    Table3.T3Col1,
    Table3.T3Col2,
    Table3.T3Col3
    From
    Table1,
    Table2,
    Table3
    where
    Table1.Prim = Table2.For
    and Table2.Prim = Table3.For
    When i ran the select statement on the view I am not getting any data. Whereas there is data when select is ran on individual table.
    Can someone please tell me where i am goofing.
    Thanks in the anticipation that i will get some hint to solve this.
    Eagerly waiting for reply.
    Thanks !!

    I mean use a collection :
    Collection Methods
    A collection method is a built-in function or procedure that operates on collections and is called using dot notation. The methods EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, NEXT, EXTEND, TRIM, and DELETE help generalize code, make collections easier to use, and make your applications easier to maintain.
    EXISTS, COUNT, LIMIT, FIRST, LAST, PRIOR, and NEXT are functions, which appear as part of an expression. EXTEND, TRIM, and DELETE are procedures, which appear as a statement. EXISTS, PRIOR, NEXT, TRIM, EXTEND, and DELETE take integer parameters. EXISTS, PRIOR, NEXT, and DELETE can also take VARCHAR2 parameters for associative arrays with string keys. EXTEND and TRIM cannot be used with index-by tables.
    For more information, see "Using Collection Methods".
    Syntax
    Text description of the illustration collection_method_call.gif
    Keyword and Parameter Description
    collection_name
    This identifies an index-by table, nested table, or varray previously declared within the current scope.
    COUNT
    COUNT returns the number of elements that a collection currently contains, which is useful because the current size of a collection is not always known. You can use COUNT wherever an integer expression is allowed.
    For varrays, COUNT always equals LAST. For nested tables, normally, COUNT equals LAST. But, if you delete elements from the middle of a nested table, COUNT is smaller than LAST.
    DELETE
    This procedure has three forms. DELETE removes all elements from a collection. DELETE(n) removes the nth element from an index-by table or nested table. If n is null, DELETE(n) does nothing. DELETE(m,n) removes all elements in the range m..n from an index-by table or nested table. If m is larger than n or if m or n is null, DELETE(m,n) does nothing.
    EXISTS
    EXISTS(n) returns TRUE if the nth element in a collection exists. Otherwise, EXISTS(n) returns FALSE. Mainly, you use EXISTS with DELETE to maintain sparse nested tables. You can also use EXISTS to avoid raising an exception when you reference a nonexistent element. When passed an out-of-range subscript, EXISTS returns FALSE instead of raising SUBSCRIPT_OUTSIDE_LIMIT.
    EXTEND
    This procedure has three forms. EXTEND appends one null element to a collection. EXTEND(n) appends n null elements to a collection. EXTEND(n,i) appends n copies of the ith element to a collection. EXTEND operates on the internal size of a collection. So, if EXTEND encounters deleted elements, it includes them in its tally. You cannot use EXTEND with index-by tables.
    FIRST, LAST
    FIRST and LAST return the first and last (smallest and largest) subscript values in a collection. The subscript values are usually integers, but can also be strings for associative arrays. If the collection is empty, FIRST and LAST return NULL. If the collection contains only one element, FIRST and LAST return the same subscript value.
    For varrays, FIRST always returns 1 and LAST always equals COUNT. For nested tables, normally, LAST equals COUNT. But, if you delete elements from the middle of a nested table, LAST is larger than COUNT.
    index
    This is an expression that must yield (or convert implicitly to) an integer in most cases, or a string for an associative array declared with string keys.
    LIMIT
    For nested tables, which have no maximum size, LIMIT returns NULL. For varrays, LIMIT returns the maximum number of elements that a varray can contain (which you must specify in its type definition).
    NEXT, PRIOR
    PRIOR(n) returns the subscript that precedes index n in a collection. NEXT(n) returns the subscript that succeeds index n. If n has no predecessor, PRIOR(n) returns NULL. Likewise, if n has no successor, NEXT(n) returns NULL.
    TRIM
    This procedure has two forms. TRIM removes one element from the end of a collection. TRIM(n) removes n elements from the end of a collection. If n is greater than COUNT, TRIM(n) raises SUBSCRIPT_BEYOND_COUNT. You cannot use TRIM with index-by tables.
    TRIM operates on the internal size of a collection. So, if TRIM encounters deleted elements, it includes them in its tally.
    Usage Notes
    You cannot use collection methods in a SQL statement. If you try, you get a compilation error.
    Only EXISTS can be applied to atomically null collections. If you apply another method to such collections, PL/SQL raises COLLECTION_IS_NULL.
    You can use PRIOR or NEXT to traverse collections indexed by any series of subscripts. For example, you can use PRIOR or NEXT to traverse a nested table from which some elements have been deleted.
    EXTEND operates on the internal size of a collection, which includes deleted elements. You cannot use EXTEND to initialize an atomically null collection. Also, if you impose the NOT NULL constraint on a TABLE or VARRAY type, you cannot apply the first two forms of EXTEND to collections of that type.
    If an element to be deleted does not exist, DELETE simply skips it; no exception is raised. Varrays are dense, so you cannot delete their individual elements.
    PL/SQL keeps placeholders for deleted elements. So, you can replace a deleted element simply by assigning it a new value. However, PL/SQL does not keep placeholders for trimmed elements.
    The amount of memory allocated to a nested table can increase or decrease dynamically. As you delete elements, memory is freed page by page. If you delete the entire table, all the memory is freed.
    In general, do not depend on the interaction between TRIM and DELETE. It is better to treat nested tables like fixed-size arrays and use only DELETE, or to treat them like stacks and use only TRIM and EXTEND.
    Within a subprogram, a collection parameter assumes the properties of the argument bound to it. So, you can apply methods FIRST, LAST, COUNT, and so on to such parameters. For varray parameters, the value of LIMIT is always derived from the parameter type definition, regardless of the parameter mode.
    Examples
    In the following example, you use NEXT to traverse a nested table from which some elements have been deleted:
    i := courses.FIRST; -- get subscript of first element
    WHILE i IS NOT NULL LOOP
    -- do something with courses(i)
    i := courses.NEXT(i); -- get subscript of next element
    END LOOP;
    In the following example, PL/SQL executes the assignment statement only if element i exists:
    IF courses.EXISTS(i) THEN
    courses(i) := new_course;
    END IF;
    The next example shows that you can use FIRST and LAST to specify the lower and upper bounds of a loop range provided each element in that range exists:
    FOR i IN courses.FIRST..courses.LAST LOOP ...
    In the following example, you delete elements 2 through 5 from a nested table:
    courses.DELETE(2, 5);
    In the final example, you use LIMIT to determine if you can add 20 more elements to varray projects:
    IF (projects.COUNT + 20) < projects.LIMIT THEN
    -- add 20 more elements
    Related Topics
    Collections, Functions, Procedures
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/13_elems7.htm#33054
    Joel P�rez

  • Sql statement for join tables

    hi there..i need ur helps
    Here are my tables n column name for each tables
    a) rep_arrngt
    Name
    REP_ARRNGT_ID
    REP_ARRNGT_DESC
    REP_ARRNGT_TYPE
    ACCT_CAT
    DEF_INDUSTRY_CODE
    MEDIA_ID
    LANGUAGE_ID
    CURRENCY
    PAGE_ID
    b) bci_rep_arrng
    Name
    REP_ARRNGT_ID
    BCI
    SUB_SUM_CODE
    DP_SUB_SUM_CODE
    c) acct_rep_arrngt_link
    Name
    ACCT_NO
    REP_ARRNGT_ID
    DOC_TYPE
    LAST_BILL_DATE
    BILL_FREQUENCY
    SCALING
    EFF_FROM_DATE
    EFF_TO_DATE
    MEDIA_ID
    Actually, i want to get the unique value for sub_sum_code according to the bci..
    i already use join tables n here is my sql statement :
    SELECT T1.SUB_SUM_CODE,T1.BCI,T1.REP_ARRNGT_ID,T2.REP_ARRNGT_ID,T3.REP_ARRNGT_ID FROM BCI_REP_ARRNG T1, REP_ARRNGT T2, ACCT_REP_ARRNGT_LINK T3 WHERE T1.REP_ARRNGT_ID=T2.REP_ARRNGT_ID AND T2.REP_ARRNGT_ID=T3.REP_ARRNGT_ID AND BCI='TTA00F06'
    n my results is :
    SUB_SUM_CODE BCI REP_ARRNGT_ID
    TBGSR TTA00F06 R1
    TBGSR TTA00F06 R1
    TBGSR TTA00F06 R1
    TBGSR TTA00F06 R1
    I get the repeated results for sub_sum_code..
    so, what i need to do if i want only 1 row results like this :
    [u]SUB_SUM_CODE BCI REP_ARRNGT_ID
    TBGSR TTA00F06 R1
    i try to use group by, but i get the error..plz help me

    If you only want "to get the unique value for sub_sum_code according to the bci" then why are you joining the tables in the first place? Not knowing PKs etc you could just use DISTINCT in your select statement.
    SELECT DISTINCT T1.SUB_SUM_CODE,
                    T1.BCI
    FROM BCI_REP_ARRNG T1
    AND BCI='TTA00F06'

  • Been getting double billed for 6 months???

    I've been getting double billed and only noticed today after going over records that adobe added a second copy of the CC plan to my account! I never asked for this and never wanted a second!
    So far that puts me $376 plus interest in the hole due to Adobe adding products I never agreed to.
    I want this rectified and my money returned.

    Hi Sue,
    Apologies for the inconvenience you have experienced. It appears that you have two active subscriptions as you signed up for a new subscription in August, 2014 and your existing membership, start date August, 2013 was renewed automatically as per the subscription terms. We have cancelled the duplicate account, you may please expect complete refund in maximum 5-7 working days.
    Please send me a PM if you have any questions.
    Regards,
    Ankush

  • How to get row count(*) for each table that matches a pattern

    I have the following query that returns all tables that match a pattern (tablename_ and then 4 digits). I also want to return the row counts for these tables.
    Currently a single column is returned: tablename. I want to add the column RowCount.
    DECLARE @SQLCommand nvarchar(4000)
    DECLARE @TableName varchar(128)
    SET @TableName = 'ods_TTstat_master' --<<<<<< change this to a table name
    SET @SQLCommand = 'SELECT [name] as zhistTables FROM dbo.sysobjects WHERE name like ''%' + @TableName + '%'' and objectproperty(id,N''IsUserTable'')=1 ORDER BY name DESC'
    EXEC sp_executesql @SQLCommand

    The like operator requires a string operand.
    http://msdn.microsoft.com/en-us/library/ms179859.aspx
    Example:
    DECLARE @Like varchar(50) = '%frame%';
    SELECT * FROM Production.Product WHERE Name like @Like;
    -- (79 row(s) affected)
    For variable use, apply dynamic SQL:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Rows count all tables:
    http://www.sqlusa.com/bestpractices2005/alltablesrowcount/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Getting double notifications for Outlook 2013 on Windows 8.1 pro

    Hi,
    I have Outlook 2013 installed on windows 8.1 pro 64bit. I am having an issue with outlook notifications, I am getting 2 notifications for each mail that I receive.
    I tried searching for the issue and found that I have desktop alerts enabled in Outlook settings and also windows 8 notifications for outlook in PC settings. Both these options generate their own notifications, so I get 2 notifications for each mail.
    When I turned off outlook notifications in PC settings, both the notifications stopped. Then I disabled desktop alerts from outlook settings and started getting only one notification.
    The issue is that both these notification look a bit different, outlook desktop alerts also show sender's photo which I prefer and I also have some outlook rules configured to show desktop alerts for only certain mails. So I want the desktop alerts to continue
    and stop standard windows 8 notifications for outlook.
    Does anyone know how to do that?
    Thanks in advance.
    SP

    Hi,
    As far as I know, Outlook email notifications are only shown in Window 8.1 if notifications are enabled in both Outlook and Windows.
    I suspect the rules are causing this double notification issue.
    You may export all the rules for backup, then start Outlook with the switch "/cleanrules":
    Win key + R, type "outlook.exe /cleanrules" in the blank box, press Enter.
    Check if the issue persists.
    If the issue is gone after running Outlook with "/cleanrules", then let's import these rules back to check the result.
    If the issue is back again, please check if any rules trigger the notification twice, use "stop processing more rules" as you need to stop the emails triggering more than one rule.
    Regards,
    Melon Chen
    TechNet Community Support

  • How to get SQL script for generating table, constraint, indexes?

    I'd like to get from somewhere Oracle tool for generating simple SQL script for generating table, indexes, constraint (like Toad) and it has to be Oracle tool but not Designer.
    Can someone give me some edvice?
    Thanks!
    m.

    I'd like to get from somewhere Oracle tool for
    generating simple SQL script for generating table,
    indexes, constraint (like Toad) and it has to be
    Oracle tool but not Designer.
    SQL Developer is similar to Toad and is an Oracle tool.
    http://www.oracle.com/technology/products/database/sql_developer/index.html

  • Get row count for different tables to the same line

    How can I get the row count for different tables in one line:
    SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;
    Thanks!

    >
    Hi,
    How can I get the row count for different tables in one line:
    SELECT count(A), count(B), count(C) from table tb_a A , tb_b B, tb_c C;Something like this? One of the many uses for CTE's - Common Table Expressions - AKA
    subquery refactoring. Worth getting to know - very handy!
    with acount as
      select count(*) as counta from dual  -- put your table name here
    bcount as
      select count(*) as countb from dual  -- put your table name here
    ccount as
      select count(*) as countc from dual  -- put your table name here
    select a.counta, b.countb, c.countc from acount a, bcount b, ccount c;HTH,
    Paul...
    Edited by: Paulie on 25-Jul-2012 17:44

  • Getting Candidate Keys for a Table?

    Hi,
    Does anyone know a way of getting a list of all candidate keys for a table? (all "UNIQUE" sets of columns defined when creating a table).
    I looked in DatabaseMetaData, but there you can only get a list of primary key fields.
    I'm using Java 1.3.1 with a PostgreSQL backend.
    Cheers
    Amar

    run a query against the Meta-data tables of the database for getting the UNIQUE columns.

  • Single (instead of Double) click for af:table editingMode="clickToEdit"

    Hi all,
    My af:table has editingMode="clickToEdit".
    A row becomes editable by double clicking on it - this is a default.
    How can I overide this editable behaviour with ONLY SINGLE click instead of Double?
    Thanks.

    Ok, I can overirde the selection listener,
    but inside that method I do not want to: setEditingMode("editAll");
    I still want the table to have editingMode="clickToEdit".
    But I want with only one click (instead of double) the row to be editable.
    So one row editable at the time.
    But only one click to show input fields.
    The tabel does not have a property (number of clicks to make the row editable) that I can control.
    In RichTable class it sais:
    In "clickToEdit" mode a single row editable at a time. A row becomes editable by double clicking on it.
    Can I overide this with: one click on the row???
    And for sure I do not want to PPR the table since default double click on the table do not refresh the whole table.
    Thanks.
    Edited by: VesnaS on 15-Jan-2010 10:47 AM

  • Rules for joining tables in SQVI

    Hi all,
    I'm new to this community and this is my first time when i post on this forum. Hope I didn't post or did anything to bad.
    I just want to know how can I know which tables should I join. I'm trying to create a report that shows me all the open items from a GL account (Construction In Progress) and have beside the AUC the AUC description, order, PO, Vendor, vendor name, plant, material (at least).
    I tried to join BSIS and ANLA for starters, but anything I select it just gives me the same error "No data was selected" Is there any rule like only the key should be selected as selection fields, anything that you could advise would be a blessing.
    Thank you
    Edited by: Viorel_Petre on Jan 18, 2011 10:52 AM

    Hi,
    Welcome to SDN!!!
    Since you are new to SAP.
    you should ask the functional consultant to provide you with the names of the tables and fields.
    the transaction SQVI is used to create queries and you can also use it to know relation bewetween tables for appplying join conditions.
    for join conditions.
    1. create  VIEW.
    2. Choose data source as table join.
    3. insert 2 tables so see the realation between them.
    search google/SDN for more information.

  • What do you do when you get double-billed for in-app purchases?

    I am getting consistently double billed for in app purchases I have done for the Candy Crush Saga and Panda Jam.  Who do I contact to discuss this issue?  Doesn't iTunes have any responsibility for apps they are offering for sale on their store??

    Apple does not police the apps unless there are serious problems with them and many complaints.
    Contact iTunes support staff who have access to your account at: http://www.apple.com/emea/support/itunes/contact.html for help.

  • Why am I getting double billed for VOD movies?

    At least twice now I have been double billed for VOD movies. Once on a movie that I just rented once and watched. Two other times for movies I stopped watching, then resumed watching well within the 48-hour time frame.

    Hello mpfrank
    Did you contact the billing department and get this resolved?

  • To get Lock object for Standard Table

    Hi all,
    i want to update table FKK_GPSHAD,so i need corresponding lock object for this table.can any one sughgest me the solution for this.
    Thanks in advance,...

    Hi,
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    check this link for example.
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    tables:vbak.
    call function 'ENQUEUE_EZLOCK3'
    exporting
    mode_vbak = 'E'
    mandt = sy-mandt
    vbeln = vbak-vbeln
    X_VBELN = ' '
    _SCOPE = '2'
    _WAIT = ' '
    _COLLECT = ' '
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Normally ABAPers will create the Lock objects, because we know when to lock and how to lock and where to lock the Object then after completing our updations we unlock the Objects in the Tables
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    purpose: If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.
    Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:
    1. enque_lockobject
    1. deque_lockobject
    before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Lock objects:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Match Code Objects:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
    See this link:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Check these links -
    lock objects
    Lock Objects
    Lock Objects
    Please reward points if useful.
    Regards
    Rose

  • Trying to get row counts for all tables at a time

    Hi,
    i am trying to get row counts in database at a time with below query but i am getting error:
    its giving me ora-19202 error..please advise me
    select
          table_name,
          to_number(
            extractvalue(
              xmltype(dbms_xmlgen.getxml('select count(*) c from '||table_name))
              ,'/ROWSET/ROW/C')
              count
        from all_tables;

    ALL_TABLES returns tables/views current user has access to. These tables/views are owned not just by current user. However your code
    dbms_xmlgen.getxml('select count(*) c from '||table_name)does not specify who the owner is. You need to change it to:
    dbms_xmlgen.getxml('select count(*) c from '||owner || '.' || table_name)However, it still will not work. Why? As I said, ALL_TABLES returns tables/views current user has access to. Any type of access, not just SELECT. So if current user is, for example, granted nothing but UPDATE on some table the above select will fail. You would have to filter ALL_TABLES through ALL_SYS_PRIVS, ALL_ROLE_PRIVS, ALL_TAB_PRIVS and PUBLIC to get list of tables current user can select from. For example, code below does it for tables/views owned by current user and tables/views current user is explicitly granted SELECT:
    select
          t.owner,
          t.table_name,
          to_number(
            extractvalue(
              xmltype(dbms_xmlgen.getxml('select count(*) c from '||t.owner || '.' || t.table_name))
              ,'/ROWSET/ROW/C')
              count
        from all_tables t,user_tab_privs p
        where t.owner = p.owner
          and t.table_name = p.table_name
          and privilege = 'SELECT'
    union all
    select
          user,
          t.table_name,
          to_number(
            extractvalue(
              xmltype(dbms_xmlgen.getxml('select count(*) c from '||t.table_name))
              ,'/ROWSET/ROW/C')
              count
        from user_tables t
    OWNER                          TABLE_NAME                                                          COUNT
    SCOTT                          DEPT                                                                    4
    U1                             QAQA                                                                    0
    U1                             TBL                                                                     0
    U1                             EMP                                                                     1
    SQL> SY.

Maybe you are looking for

  • Why is Adobe Muse kind of slow?

    i have adobe Muse on a Win 7 Machine running with 4gb of Ram and a solid state drive. Should I up my memory to 8? I realize that would definately help but is that what is causing my issue

  • Get layer style settings from the differences between 2 images.

    Hello People, I have a question: Is it possible to get the layer style settings when I have 1 image with the layer style and 1 without it. Let's say I have an icon that's just a house. [img]http://s6.postimage.org/xfpzl5hl9/image.png[/img] And I have

  • Cannot Open in OSX 10.4.2 running OS9 Classic

    There are some problem not only in just in DVD Studio Pro, but also : 1) I cannot install and boot from the OS 9.x CD which came with my old G4 in my new Dual G5, 2GHz. Is it true or any things I must done before ? 2) I then install OS9 Classic in OS

  • Special Character CDATA

    Hi Team, I did go through the earlier posts on CDATA.. we were just not able to get the desired results. We have a RDF report where we extract the field Invoice description from the database. The description has special characters, we want the xml no

  • After updating iTunes and rebooting MacBook Pro does not reboot.

    So after installing the update of the new iTunes the system needed to reboot. Screen remains black, battery is full and even with connection to the power network. When pressing the power button you hear the system starts working but stops after unpre