Query to find out the list of tables used in a package

hello,
can anyone please help me out with a query; i want to find out the list of tables used by a particular package.
thanks,
orton

orton607 wrote:
thanks for replying guys. But the thing is i am using dynamic sql execute immediate in my package, so i want those tables also and the schema name.
thanks,
ortonThis is not possible. The best you could do is to have a good guess.
Or how would you parse some dynamic statement as this:
   v_suffix := 'loyees';
   v_sql := 'Select count(*) from (select ''nonsense'' col1 from emp'||v_suffix||') where col1 = ''Y'''';
   execute_immediate(v_sql);
...What is the table name? How do you want to parse that?
Better rewrite all dynamic SQL statements into non dynamic ones. Or do the source control logic for those dynamic parts in an extra module. For example implement your own dependency table and force every developer to add there all dynamic parts.

Similar Messages

  • Query to find out the list of user who have delete access

    Hi,
    I need a query to find out the list of users who have delete access on perticular folder/universe/ reports  in infoview.
    Please advice.
    Regards,
    Neo.

    orton607 wrote:
    thanks for replying guys. But the thing is i am using dynamic sql execute immediate in my package, so i want those tables also and the schema name.
    thanks,
    ortonThis is not possible. The best you could do is to have a good guess.
    Or how would you parse some dynamic statement as this:
       v_suffix := 'loyees';
       v_sql := 'Select count(*) from (select ''nonsense'' col1 from emp'||v_suffix||') where col1 = ''Y'''';
       execute_immediate(v_sql);
    ...What is the table name? How do you want to parse that?
    Better rewrite all dynamic SQL statements into non dynamic ones. Or do the source control logic for those dynamic parts in an extra module. For example implement your own dependency table and force every developer to add there all dynamic parts.

  • How to find out the Non Partitioned Tables used 2Gb on oracle

    Hi team
    how to find out the Non Partitioned Tables used > 2Gb on oracle where not is sys & system
    regards

    heres 1 I made earlier
    set pagesize 999
    set linesize 132
    col owner format a25
    col segment_name format a60
    select owner,segment_name,segment_type,(bytes/1024/1024)"MB size"
    from dba_segments
    where owner not in ('SYS','SYSTEM','XDB','MDSYS','SYSMAN') -- edit for taste
    and segment_type = 'TABLE'
    having (bytes/1024/1024) > 2000
    group by bytes, segment_Type, segment_name, owner
    order by 4 asc

  • Query to find out the Activities done against a table

    Hi,
    One table has been truncated and data reloaded into the table by the user. But at latter stage user deny that activity. I believe all these activities stored in any oracle 10g database table.
    Need a query to find out the activities done on a specific date say 6th Sep.
    This is too urgent. Thanks in advance

    Hi,
    Welcome to the forum!
    If you don't have enable table auditing maybe you can see last_ddl_time column of user_objects view:
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> select * from test2;
          COL1       COL2       COL3
             1          1          3
             1          2          3
             1          3          3
    SQL> select to_char(uo.created, 'DD/MM/YYYY HH24:MI:SS'), to_char(uo.last_ddl_time, 'DD/MM/YYYY HH24:MI:SS') from user_objects uo where uo.object_name = 'TEST2';
    TO_CHAR(UO.CREATED,'DD/MM/YYYY TO_CHAR(UO.LAST_DDL_TIME,'DD/M
    12/09/2009 12:20:26            12/09/2009 12:20:27
    SQL> truncate table test2;
    Table truncated
    SQL> select to_char(uo.created, 'DD/MM/YYYY HH24:MI:SS'), to_char(uo.last_ddl_time, 'DD/MM/YYYY HH24:MI:SS') from user_objects uo where uo.object_name = 'TEST2';
    TO_CHAR(UO.CREATED,'DD/MM/YYYY TO_CHAR(UO.LAST_DDL_TIME,'DD/M
    12/09/2009 12:20:26            12/09/2009 14:01:21
    SQL> Regards,

  • Please give the query to find out primary key in table in Sql plus

    Dear friends,
    Please give me the query to find out the primary key in Sql plus.

    hi
    SQL> DESC user_constraints
    Name                                                                                                  
    OWNER                                                                                                 
    CONSTRAINT_NAME                                                                                       
    CONSTRAINT_TYPE                                                                                       
    TABLE_NAME                                                                                            
    SEARCH_CONDITION                                                                                      
    R_OWNER                                                                                               
    R_CONSTRAINT_NAME                                                                                     
    DELETE_RULE                                                                                           
    STATUS                                                                                                
    DEFERRABLE                                                                                            
    DEFERRED                                                                                              
    VALIDATED                                                                                             
    GENERATED                                                                                             
    BAD                                                                                                   
    RELY                                                                                                  
    LAST_CHANGE                                                                                           
    INDEX_OWNER                                                                                           
    INDEX_NAME                                                                                            
    INVALID                                                                                               
    VIEW_RELATED                                                                                          
    SQL> SELECT constraint_name,table_name,r_constraint_name,status
      2  FROM user_constraints WHERE constraint_type='P';
    CONSTRAINT_NAME                TABLE_NAME                     R_CONSTRAINT_NAME              STATUS
    SYS_C003141                    CUSTOMERS                                                     ENABLED
    PK_DEPT                        DEPT                                                          ENABLED
    SYS_C003139                    SALESREPS                                                     ENABLEDKhurram

  • How can I find out the list of users who has the access to IT 0008

    All,
    How can I find out the list of users who has the W R permission for IT 008
    for others?
    SUIM doe not look like giving me the correct results.
    Please advise.
    Thanks,
    From
    PT.

    combine tables AGR_1251 and table AGR_Users on keyfield AGR_USERS
    in tabel AGR_1251 select on Field LOW values IT0008.OR W OR R,
    noiw you get also other values
    So better solution run the query twice over AGR1251 first on IT0008 and secondly on values W OR R and then the result over table AGR_USERS
    Youu also might put an additional selection on object P* (only selecting HR objects)
    output wll be UID in table AGR_USERS

  • How to find out the list of field exists for a particular transaction

    Hi all,
    Can u please help me find out the list of field exits available for a particular Tcode?
    Is it similar to User exit or . . . . ?
    Thanks,
    C.Selvaraj
    SAP-QM

    Create a program and add this code to find user exit
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
    tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
      select single * from tadir where pgmid = 'R3TR'
      and object = 'PROG'
      and obj_name = tstc-pgmna.
      move : tadir-devclass to v_devclass.
      if sy-subrc ne 0.
        select single * from trdir where name = tstc-pgmna.
        if trdir-subc eq 'F'.
          select single * from tfdir where pname = tstc-pgmna.
          select single * from enlfdir where funcname =
          tfdir-funcname.
          select single * from tadir where pgmid = 'R3TR'
          and object = 'FUGR'
          and obj_name eq enlfdir-area.
          move : tadir-devclass to v_devclass.
        endif.
      endif.
      select * from tadir into table jtab
      where pgmid = 'R3TR'
      and object = 'SMOD'
      and devclass = v_devclass.
      select single * from tstct where sprsl eq sy-langu and
      tcode eq p_tcode.
      format color col_positive intensified off.
      write:/(19) 'Transaction Code - ',                        "#EC NOTEXT
      20(20) p_tcode,
      45(50) tstct-ttext.
      skip.
      if not jtab[] is initial.
        write:/(95) sy-uline.
        format color col_heading intensified on.
        write:/1 sy-vline,
        2 'Exit Name',                                          "#EC NOTEXT
        21 sy-vline ,
        22 'Description',                                       "#EC NOTEXT
        95 sy-vline.
        write:/(95) sy-uline.
        loop at jtab.
          select single * from modsapt
          where sprsl = sy-langu and
          name = jtab-obj_name.
          format color col_normal intensified off.
          write:/1 sy-vline,
          2 jtab-obj_name hotspot on,
          21 sy-vline ,
          22 modsapt-modtext,
          95 sy-vline.
        endloop.
        write:/(95) sy-uline.
        describe table jtab.
        skip.
        format color col_total intensified on.
        write:/ 'No of Exits:' , sy-tfill.                      "#EC NOTEXT
      else.
        format color col_negative intensified on.
        write:/(95) 'No User Exit exists'.                      "#EC NOTEXT
      endif.
    else.
      format color col_negative intensified on.
      write:/(95) 'Transaction Code Does Not Exist'.            "#EC NOTEXT
    endif.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.
    Rewards if useful........................
    Minal

  • How to find out the list of implemented OSS Notes in a particular period.

    Hi Friends,
    Need help.
    I need to find out the list of OSS Notes implemented in a period in a particular system.
    Could you please suggest the table or program or any way to find out the OSS Notes Implemented date wise?
    Thanks in Advance.
    Sreenivas

    Hi Sreenivas.
    How did you find the solution to this? Trying to do the same thing!
    Cheers,
    Tom

  • How to find out the list of workflows with active event linkage?

    Hi All,
    I want to find out the list of workflows whoe event linkage is activated in the system.
    Through SWU0, we can get a list of workflows attached to a particular event of a business object.
    Thanks,
    Sivagami

    Hi,
    Thanx for ur reply..
    I got the list from the table...
    thanks,
    sivagami

  • How to find out the list of all user's whose passwords are expired

    Hi
    i had tried to find out the list of all user's whose passwords are expired.
    i had written some jndi code by finding the max age and then find out the current time and subtracted this current time from max age using the following code
    "Attributes attbts=ctx.getAttributes("cn=pwdpolicy");
    String maxAge=(String)attbts.get("pwdMaxAge").get();
    Date Today = new Date();
    System.out.println("maxAge"+maxAge);
    long curTime=(Today.getTime())-Long.parseLong(maxAge)*1000;"
    and then parse it and create a string time as follows
    String time=year+month+day+hour+minute+second+"Z";
    where "year" "month" etc were parsed from curTime
    now i can get the list by using following code
    "String filterCriteria="(&(objectclass=person)(pwdChangedTime>="+time+")";
    NamingEnumeration results = ctx.search(baseDN,filterCriteria, sc); "
    but the current time which i am getting is the time of my system not the time of ldap server
    so my questions are following;
    1.Can there is any way by which i can get the tivole sever's system time.
    2.If there is no way then can you suggest any other way to find out the list of user's whose passwords are expired.
    please help me.
    Thanks.
    Krishan Rathi.

    Hi,
    Thanx for ur reply..
    I got the list from the table...
    thanks,
    sivagami

  • Need query to find out the sum till a period

    Hi,
    I need to write one query to find out the cumulative sum of raw_cost of table pa_budget_lines till the specified period, I tried to do this by analytical function, but that is not working in Report 10g. Can anybody help me in this.
    Thanks

    not familiar with report but could you do something like this
    with t as
      select 1 grp, 10 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11 union all
      select 2 grp, 5 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11
    input as
      ( select null grp, null the_cost, null running_total,  v_eff_dt effective_dt   from dual)
    select * from(
    select t.grp, t.the_cost, sum(t.the_cost) over (partition by t.grp order by t.effective_dt) running_total, t.effective_dt,
           lead(t.effective_dt) over (partition by t.grp order by t.effective_dt) next_effective_dt,
           input.effective_dt  inp_eff_dt
    from t, input
    where inp_eff_dt between effective_dt and next_effective_dtv_eff_dt would be the input date you are interested in

  • How to find out the list of patches applied without using inventory?

    Hi,
    I have been asked this question once.
    How will you find out the list of patches applied to Oracle Database Home without using commands like opatch lsinventory -detal etc...
    I think registry$history is a view from where we can find out the list of patches applied.
    But I think it will not include all the bug fixes,stand alone or one-off patches.It will mainly list out the CPU patches applied(correct me if I am wrong).
    Thanks,
    Rushi

    Hi;
    Thanks Helios,
    Your welcome
    Could you tell me how do you all senior people manage to find metalink note for almost everything?There is nothing special, For me I just make more search at metalink than googling so after sometimes you started to notice which note could be related wiht issues more clearly.. Just keep searching at metalink and focus what you are searching only.. ;)
    If you could guide me I can do it my self and stop bothering you for some silly doubts.You dont bother me and also I belive the other forum users ;) We are also learning new information wiht user questions ;)
    Regard
    Helios

  • How to find out the list of includes:

    Hi,
    I want to find out the list of includes, hw can I do that..
    Suppose: ex: I want to know all the includes starting with zabc* hw can I do it, and one more question, where all the (total) includes will be stored.
    Akshitha.

    Hi akshitha,
    1. We can do that from se38.
    2. in se38, Press Ctrl + F
    3. A new window will come for search.
    4. <b>by pressing 4th button on toolbar, expand the search window.</b>
    5. <b>In "Program Type", enter   :   I   (for include only)
       In Program Name" enter    : ZABC*</b>
    6. Execute.
    regards,
    amit m.

  • Query to find out the time used by an user for an application

    Hello All,
    I want to know the query to find out the whole time used by the user for an application. Please view the below data
    Employee:
    SNO EMP_ID EMP_NAME EMP_DATE LOGIN_TIME LOGOUT_TIME
    1 10 Visu 21-Nov-2010 06:30:00 07:30:00
    2 10 Visu 21-Nov-2010 06:40:00 07:20:00
    3 10 Visu 21-Nov-2010 06:50:00 07:50:00
    4 10 Visu 21-Nov-2010 07:30:00 08:30:00
    5 10 Visu 21-Nov-2010 09:30:00 10:30:00
    By checking the above data we can say that the total time Visu used the application is
    8.30 - 6.30 (From 1,2,3,4 records) = 2hrs
    10.30 - 9.30 (Based on 5th rec) = 1hr
    So the total time Visu used the application would be 3 hrs = 180 mins.
    Could you please help me in getting the result from that data using a query?

    odie_63 wrote:
    I think it may be solved with analytics too.
    with t1 as (
                select 1 sno,10 emp_id,'Visu' emp_name,'21-Nov-2010' emp_date,'06:30:00' login_time,'07:30:00' logout_time from dual union all
                select 2,10,'Visu','21-Nov-2010','06:40:00','07:20:00' from dual union all
                select 3,10,'Visu','21-Nov-2010','06:50:00','07:50:00' from dual union all
                select 4,10,'Visu','21-Nov-2010','07:30:00','08:30:00' from dual union all
                select 5,10,'Visu','21-Nov-2010','09:30:00','10:30:00' from dual
         t2 as (
                select  emp_id,
                        emp_name,
                        emp_date,
                        to_date(emp_date || login_time,'DD-MON-YYYYHH24:MI:SS') login_time,
                        to_date(emp_date || logout_time,'DD-MON-YYYYHH24:MI:SS') logout_time
                  from  t1
         t3 as (
                select  t2.*,
                        case
                          when login_time < max(logout_time) over(
                                                                  partition by emp_id,emp_date
                                                                  order by login_time
                                                                  rows between unbounded preceding
                                                                           and 1 preceding
                            then 0
                          else 1
                        end start_of_group
                  from  t2
         t4 as (
                select  t3.*,
                        sum(start_of_group) over(partition by emp_id,emp_date order by login_time) grp
                  from  t3
         t5 as (
                select  emp_id,
                        emp_date,
                        min(login_time) login_time,
                        max(logout_time) logout_time
                  from  t4
                  group by emp_id,
                           emp_date,
                           grp
    select  emp_id,
            numtodsinterval(sum(logout_time - login_time),'day') time_spent
      from  t5
      group by emp_id
      order by emp_id
        EMP_ID TIME_SPENT
            10 +000000000 03:00:00.000000000
    SQL> SY.

  • Find out the SQLs which are using a full table scan

    Hello all , how can i to find out the queries which are using a full table scan ? Any idea ?

    In general, though, why would you want to tune SQL statements that aren't causing problems? Statspack will tell you what the most resource-intensive SQL statements on your system are. A SQL*Net trace of sessions that are performing poorly will indicate which statements are the most resource-intensive for that session. If a statement is incorrectly doing a full-table scan, but it is not causing a problem, why spend time tuning it? If you're not focusing your tuning attention on identifying statements that are causing problems, you'll also miss out on 90% of tuning opportunities which involve rewriting (or eliminating) code to make it more efficient. I can simulate a join on two tables with nested cursor loops, which won't generate a single full table scan, but replacing that code with a real join, while it will cause at least one full table scan, will be orders of magnitude faster.
    As an aside, full table scans aren't necessarily a bad thing. If a statement needs to retrieve more than a couple percent of the rows of a table, full table scans are the most efficient way to go.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for