Query for Tables used in a Schema

I need to know that how many tables in the schema has been used by Proceudres/Functions, Packages Triggers etc.
Please give me the query if someone has it.
Thanks and Regards,
Kapil Uppal

Hi kapil wher do u stay......do u stay at UPPAL....grt,mine location is also uppal

Similar Messages

  • Issue While executing the Query for Pagination using ROWNUM with like

    Issue While executing the Query for Pagination using ROWNUM with like.
    Database is Oracle11G.
    Oracle Database Table contains 8-9 lakh records
    1) SQL equal (=)
    SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
    WHERE A.REFERENCE = 'KMF22600920'
    Execution Time:- 0.00869245 seconds
    Returns 2 resultsets
    2) SQL like (one %)
    SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
    WHERE A.REFERENCE = 'KMF22600920%'
    Execution Time:- 0.01094301 seconds
    Returns 2 resultsets
    3) SQL like (two%)
    SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
    WHERE A.REFERENCE like '%KMF22600920%'
    Execution Time:- 6.43989658 seconds
    Returns 2 resultsets
    In Pagination, we are using Modified version of SQL Query 3) with ROWNUM as mentioned below :-
    4) SELECT * FROM (
    SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
    WHERE REFERENCE like '%KMF22600920%' AND ROWNUM <= 20 ) WHERE RNUM > 0
    Execution Time:- Infinite
    ResultSets:- No as execution time is infinite
    a) Instead of like if we use = in the above query it is returning the 2 resultsets (execution time 0.02699282 seconds)
    b) Instead of two % in the above query, if use one example REFERENCE like 'KMF22600920%' it is returning the 2 resultsets (execution time 0.03313019 seconds)
    Issue:- When using two % in like in the above query i.e. REFERENCE like '%KMF22600920%' AND ROWNUM <= 20 ) , it is going to infinite.
    Could you please let us know what is the issue with two % used in like and rownum
    5) Modified version of Option1 query (move out the RNUM condition AND RNUM <= 20)
    SELECT * FROM (
    SELECT /*+ FIRST_ROWS(n) */ ROWNUM RNUM, A.* FROM LINE A
    WHERE REFERENCE like '%KMF22600920%' ) WHERE RNUM > 0 AND RNUM <= 20
    Execution Time:- 7.41368914 seconds
    Returns 2 resultsets
    Is the above query is best optimized query which should be used for the Pagination or still can improve on this ?

    This would be easier to diagnose if there was an explain plan posted for the 'good' and 'bad' queries. Generally speaking using '%' on both sides precludes the use of any indexes.

  • Query a table using Multi Select Item

    Hi everyone!
    I got a page where I have this multiselect item, and I want to query a table using its values.
    For example: The Multiselect item has this values: 1,2,3,4,5,6,7,8,9 and 10
    And I want to query every person who has ID_CLASS 1,4,7 and 9 by selecting those IDs from the list, and when I click que Consult button the Report displays those persons.
    Whowever I can't accomplish this, I was trying to find a post about this without success.
    Can anybody help me with this?
    Thanks!!

    Hi,
    This is my problem, I select 2 or more options in the multiple select item, then after I click the "Consult" buttom it submits the page, however only 1 option is highlighted. For example I choose the first two options, then I click Consult and the page is submitted. After that only one of the 2 options are selected, but I need to get the 2 options highlighted as selected items.
    If I clear cache I think I'll lost everything. (selected items)
    Thanks again!

  • DYNAMIC QUERY FOR INSERT USING SELECT

    Hi All,
    I am facing an issue...I am un bale to do an dynamic query. i have explained my code and the sample create, insert statements. I shud insert values in a table using a select statement dynamically..
    create table listing (tel_no varchar2(16), list_key varchar2(30));
    create table dummy_extract ( extract_name varchar2(10),extract_query varchar2(400),extract_date date );
    create table dummy_query (tel_no varchar2(16), list_key varchar2(30));
    insert into listing (tel_no ,header_key) values ('123456','123.23');
    insert into dummy_extract (extract_name,extract_query,extract_date) values ('SP','SELECT TEL_NO, LIST_KEY FROM LISTING','10-DEC-2010');
    SET SERVEROUTPUT ON
    declare
    CURSOR CUR_QUERY IS
    SELECT * FROM DUMMY_EXTRACT ;
    V_STMT VARCHAR2(4000);
    BEGIN
    FOR I IN CUR_QUERY LOOP
    V_STMT := 'INSERT INTO DUMMY_QUERY VALUES ' ||(I.EXTRACT_QUERY ) ;
    EXECUTE IMMEDIATE V_STMT using i.extract_query;
    DBMS_OUTPUT.PUT_LINE (V_STMT);
    END LOOP;
    END ;

    Hi Blue shadow and Saubik,
    I tried my query.It shows missing expression...Could you tell me the reason...
    SET SERVEROUTPUT ON
    declare
    CURSOR CUR_QUERY IS
    SELECT * FROM DUMMY_EXTRACT ;
    V_STMT VARCHAR2(4000);
    BEGIN
    FOR I IN CUR_QUERY LOOP
    --V_STMT := 'INSERT INTO'|| DUMMY_QUERY ||'VALUES ' ||(I.EXTRACT_QUERY ) ;
    EXECUTE IMMEDIATE 'INSERT INTO DUMMY_QUERY VALUES ' ||(I.EXTRACT_QUERY ) ;
    DBMS_OUTPUT.PUT_LINE (V_STMT);
    END LOOP;
    END ;
    Error report:
    ORA-00936: missing expression
    ORA-06512: at line 14
    00936. 00000 - "missing expression"
    *Cause:   
    *Action:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to gather table stats for tables in a different schema

    Hi All,
    I have a table present in one schema and I want to gather stats for the table in a different schema.
    I gave GRANT ALL ON SCHEMA1.T1 TO SCHEMA2;
    And when I tried to execute the command to gather stats using
    DBMS_STATS.GATHER_TABLE_STATS (OWNNAME=>'SCHMEA1',TABNAME=>'T1');
    The function is failing.
    Is there any way we can gather table stats for tables in one schema in an another schema.
    Thanks,
    MK.

    You need to grant analyze any to schema2.
    SY.

  • How to create query for tables with many to many relationship

    in my sql i'm unable to update the table using select clause...is there any way to update a table which is in many to many relationship.
    Ex:1st table student(student_id int primary key auto_increment, student_name varchar(30));
    2nd table contact (contact_id int primary key auto_increment, c_email varchar(40));
    3rd table student_contact(student_id int references student, contact_id int references contact);
    i would like to auto insert the both two columns in the student_contact while the student and the contact table being updated automatically.

    This is a JSP/JSTL forum, not a SQL forum. If you're using MySQL, better use their own forums at dev.mysql.com.
    I'll give some hints anyway: learn about SQL JOIN. In general there is good SQL documentation available at the website of the RDBMS manfacturer. Go check it out. There is also a nice SQL tutorial at w3schools.com. Good luck.

  • Re querying a table using ONE Select

    Hello Experts,
    In one hit i want to query a Table2 2 times using oNE select query
    Lets say, i have 2 database tables  : Table1 & Table2.
    & internal tables say itab1 & itab2.
    Lets say they have fields:  fld1 fld 2 fld3 fld4.
    1) I used select * from Table1 into table itab1.
    2) Now i want to get entries from table2 based on itab-fld1 and itab2-fld4
    select * from Table2 into itab2
    FOR ALL ENTRIES in itab1
    where fld1 = itab1-fld1
      and fld2 = *itab2-fld4*  (entries based on
    itab2)
    Please suggest.,
    Thanks
    Ricky

    Hi Ricky,
    it is almost impossible to explain anything if you do not have an example of what you are going to do. When I say example, I don not mean Lets say, i have 2 database tables or Lets say they have fields but a case that everyone understands.
    If you are talking about SAP tables, give the names and fields. If you are talking about user-defined tables, decribe the process, give table and field names and characteristics (data element, domain, check table, search help...) of each field.
    For the question Now please tell me how can i write aliasing the answer is a clear F1.
    Shortly: If you write <tabname> AS <alias> or <fieldname> AS <alias> this means that <tabname> and <fieldname> identifie table and field in the database and <alias> is used for it in the query clause and for the data transfer from database to INTO data object.
    Note: It is always better to ask a question for a specific task. Getting the answer you can use it in all tasks that are comparable to the one you asked for. Asking a bla-bla question ( Lets say... ) will rarely get a useful answer.
    Regards,
    Clermens

  • EA3: Bug in dependencies query for table tab

    SQL Developer 1.5EA3, JDK 1.6.0_04
    I have just noticed a problem with the dependencies query on the table tab - it only shows dependencies where the referencing object is owned by the table owner and for any object with the same name as the table owner.
    The query is:
    sselect owner, name, type, referenced_owner, referenced_name, referenced_type ,owner sdev_link_owner, name sdev_link_name, type sdev_link_type from ALL_DEPENDENCIES where owner = :OBJECT_OWNER and referenced_name = :OBJECT_NAME
    Instead of restricting owner to :OBJECT_OWNER, it should be restricting referenced_owner to :OBJECT_OWNER.
    theFurryOne

    I think the arrow keys could be used for navigating the grid, and Alt-Down Arrow and Alt-Up Arrow could be used for viewing the drop-down list.
    How about instead of allowing someone to type in the value, have them select from a list? The index columns can only be columns on the table, and if a column is already chosen for the index, remove it from the list.
    I think the behavior of Microsoft's Table Designer is similiar.
    What do you think?

  • How to Create Filter by date Query for access using Data base connectivity tool

    Hello,
    I had started my project by reading Access datas, by using an UDL connection,
    but now i want to create an access filter using a query that would permit to select two dates, and to obtain all corresponding datas, how to do it using the Parmetrized SQL query?
    Best regards,
    Remark: i dont know the SQL language
    ~~~~~~~~~~~~~~~~~~Looking for a LABVIEW JOB (In EUROPE)>~~~~~~~~~~~~~~~~~~
    **The Best Way To Predict**The**Future Is To Invent It**
    Solved!
    Go to Solution.

    Hi mike,
    I want to thank you for your help, i really appreciate it,
    i tried to make the code as ur picture, i had no problem to execute it, but i have no data's in the output
    i changed the date format, because i suppose that its a short date format in the database.
    can you just look at it, and tell me if you can find the problem,
    thank you again for your help
    Best regards,
    ~~~~~~~~~~~~~~~~~~Looking for a LABVIEW JOB (In EUROPE)>~~~~~~~~~~~~~~~~~~
    **The Best Way To Predict**The**Future Is To Invent It**
    Attachments:
    db.JPG ‏126 KB
    lav.JPG ‏82 KB

  • Field symbols for tables used under tables tabstrip in bapi

    Hi all,
    I am created a bapi and under tables tabstrip i have given  3 tables,
    Inside the bapi , i have written a perform statement which returns these 3 tables .
    PERFORM bapi_sales TABLES it_valid it_error it_errorc USING testrun.
    how can we create field symbols for these tables ?
    Regards
    Nagarah

    hi,
    goto: system-utilities- debug system
    A.
    Message was edited by: Andreas Mann

  • Transaction for table used by programs

    Hi All,
    I want to know the table TOA01 is used by program.
    Please let me know any transaction is theare for this.
    Thanks and regards,
    zubera

    Hi,
    follow these navigation steps,
    ->SE11
    ->Enter the Table name as TOA01
    ->Hit (CtrlShiftF3) or Click on Where-Used-List from Application toolbar
    ->Select Programs, Deselect Other options(if u want only program names)
    ->Click on Continue
    Bye,
    KC

  • SIngle query for table Update

    In a procedure I have a CURSOR FOR_LOOP
      FOR CUR_CONTO in
         (SELECT TO_NUMBER(lpad(nvl(ltrim(K_DRG),'0'),3,'0')   ) K_DRG,
             CASE
            WHEN K_MDC  = 'NA' THEN 0
             WHEN K_MDC <> 'NA' THEN TO_NUMBER( lpad(nvl(ltrim(K_MDC),'0'),2,'0')   )
             END K_MDC,
                     TO_NUMBER(substr(PAZIENTE,     instr(PAZIENTE,'@')+1, 4) ) KCODET, 
                     substr(PAZIENTE,     instr(PAZIENTE,'@')+5, 1)           TIPORDT,  
                     TO_NUMBER(SUBSTR(N_CCLINICA,1,4) )                      ANNOT
                FROM table_g)
         LOOP
         UPDATE table_dm SET K_DRG = CUR_CONTO.K_DRG , K_MDC = NVL(CUR_CONTO.K_MDC,0)
                        WHERE  K_CODE  = CUR_CONTO.KCODET
                        AND    TIPORD  = CUR_CONTO.TIPORDT
                        AND    ANNO    = CUR_CONTO.ANNOT ;
         end  LOOP;
      I want change it in a single query, how can I do?
    I write
    UPDATE table_dm SET K_DRG , K_MDC =
        (SELECT     TO_NUMBER(lpad(nvl(ltrim(K_DRG),'0'),3,'0')   ) K_DRG,
             CASE
            WHEN K_MDC  = 'NA' THEN 0
             WHEN K_MDC <> 'NA' THEN TO_NUMBER( lpad(nvl(ltrim(K_MDC),'0'),2,'0')   )
             END K_MDC FROM table_g )
                but I don't know how insert in the where the variable KCODET, TIPORDT ,ANNOT get from table table_g
    WHERE K_CODE = CUR_CONTO.KCODET
    AND TIPORD = CUR_CONTO.TIPORDT
    AND ANNO = CUR_CONTO.ANNOT ;
    And How can I lock table_dm because it has some trigger in updating?
    Thanks in advance

    It should be something like this
    UPDATE table_dm dm
        SET (K_DRG, K_MDC) = (
                    SELECT k_drg, NVL(k_mdc,0)
                      FROM (SELECT TO_NUMBER(lpad(nvl(ltrim(K_DRG),'0'),3,'0')   ) k_drg,
                             CASE
                                  WHEN k_mdc  =  'NA' THEN 0
                                  WHEN k_mdc  != 'NA' THEN TO_NUMBER( lpad(nvl(ltrim(k_mdc),'0'),2,'0'))
                             END k_mdc,
                             TO_NUMBER(substr(paziente, instr(paziente,'@')+1, 4)) kcodet, 
                             substr(paziente, instr(paziente,'@')+5, 1) tipordt,  
                             TO_NUMBER(SUBSTR(n_cclinica,1,4)) annot
                           FROM table_g) t
                     WHERE t.kcodet  = dm.k_code
                       AND t.tipordt = dm.tipord
                       AND t.annot   = dm.annot
      WHERE EXISTS (
               SELECT null
                 FROM (SELECT TO_NUMBER(lpad(nvl(ltrim(K_DRG),'0'),3,'0')   ) k_drg,
                        CASE
                             WHEN k_mdc  =  'NA' THEN 0
                             WHEN k_mdc  != 'NA' THEN TO_NUMBER( lpad(nvl(ltrim(k_mdc),'0'),2,'0'))
                        END k_mdc,
                        TO_NUMBER(substr(paziente, instr(paziente,'@')+1, 4)) kcodet, 
                        substr(paziente, instr(paziente,'@')+5, 1) tipordt,  
                        TO_NUMBER(SUBSTR(n_cclinica,1,4)) annot
                      FROM table_g) t
                WHERE t.kcodet  = dm.k_code
                  AND t.tipordt = dm.tipord
                  AND t.annot   = dm.annot
                )Note: Code not tested

  • ORA-0907 error when querying XMLDB Table using XMLExists

    Hi All,
    Get ORA-00907 error when trying to use XMLExists:
    SELECT *
    FROM tnmab_agreement_xml_binary A
    WHERE
    ( XMLExists('declare default element namespace "http://com.oocl.schema.tnm.agreementbuilder"; $XML/Agreement/ShippingPartyGroups/ShippingParties/CustomerHolder[SAP_ID="$ARG"]')
    passing agreements.AGREEMENT_XML as "XML", '5000003001' as "ARG")
    OR
    ( XMLExists('declare default element namespace "http://com.oocl.schema.tnm.agreementbuilder"; $XML/Agreement/NamedCustomerGroups/NamedCustomer/SAP_IDs/StringWrappers[Value="$ARG"]')
    passing agreements.AGREEMENT_XML as "XML", '5000003001' as "ARG")
    ORA-00907: missing right parenthesis
    *00907. 00000 - "missing right parenthesis"*
    **Cause:*
    **Action:*
    Error at Line: 6 Column: 176
    Any help is appreciated
    Thanks
    Auro

    XMLExists('declare default element namespace "http://com.oocl.schema.tnm.agreementbuilder"; $XML/Agreement/ShippingPartyGroups/ShippingParties/CustomerHolder[SAP_ID="$ARG"]'
    passing agreements.AGREEMENT_XML as "XML", '5000003001' as "ARG")no ')' after the closing quote

  • Plz help, A select query for table giving foll o/p

    A table has a single column with following data
    Col1
    170
    10
    140
    520
    20
    60
    70
    The select query should return the data in the following format
    Col1 Col2 Col3 Col4
    170 3 1 0
    10 0 0 1
    140 2 2 0
    520 10 1 0
    20 0 1 0
    60 1 0 1
    70 1 1 0

    Using my awesome puzzle solving brain I note that Col2 = 50 Col3 = 20 Col4 = 10.
    But you should be telling US that.
    select col1, floor(col1/50) col2, floor(mod(col1,50)/20) col3, floor(mod(mod(col1,50),20)/10) col4
    from mytable.
    I win the internets!
    Edited by: Dave Hemming on Dec 19, 2008 11:35 AM

  • How to query for tables referenced to a certain table by a FK?

    Hello -
    I have a table called "SERVICE". i can't drop the table because it is referenced via a foreign key by other tables. What view(s) can I query to find the referenced tables?
    Thanks in advance!

    Does this query help?
    select /*+ parallel(4) */
    pk.table_name parent_table_name, pk.constraint_name pkey_constraint,
    fk.table_name child_table_name, fk.constraint_name fkey_constraint, fk.r_constraint_name
    from
    user_constraints pk,
    user_constraints fk
    where
    pk.constraint_name = fk.r_constraint_name
    and pk.constraint_type='P'
    and fk.constraint_type='R'

Maybe you are looking for

  • Map security roles to group within LDAP using external 3rd Party LDAP

    I'm haveing a problem mapping my logical role defined in my web.xml to a role within Active Directory. I'm currently authenticating using Active Directory succsfully, however after the user is authenticated I get a message from the OC4J container tha

  • How do you download an older version for App World

    i tried rebooting it, it still doesnt appear on my homepage... i checked on the applications, it is there.. how to find it? MOD EDIT: Subject changed to reflect a new topic

  • Various Site Problems

    http://jobs.oracle.com/ Code is as follows: <!-- Copyright &copy 1995,1998, Oracle Corporation, All Rights Reserved. --> <HTML> <BODY> <title>HTML META tag refresh</title> <meta http-equiv="Refresh" content="0;url=http:/jol_ext-jolap-dad/plsql/jol_ww

  • Error in  bibean applet with latest  JRE

    We have bi bean application developed using Applet It works fine with JRE 1.5 or earlier JRE version but when I access same thing in PC that has JRE 1.5.0_09 it gives XML error <Line 5, Column 21>: XML-20123: (Fatal Error) '>' Missing from end tag. <

  • How to remove apple id i forgot my password

    please help i forgot my apple password how to recover