How to find the columns and tables used in a stored procedure?

Hi,
Can someone suggest how to find the columns and tables used within a stored procedure?
Thanks
VBK

For example:
SQL> create or replace
  2    procedure p1
  3      is
  4          cnt number;
  5      begin
  6          select count(*) into cnt from emp;
  7  end;
  8  /
Procedure created.
SQL> select  referenced_owner,
  2          referenced_name
  3    from  dba_dependencies
  4    where owner = 'SCOTT'
  5      and name = 'P1'
  6      and referenced_type = 'TABLE'
  7  /
REFERENCED_OWNER               REFERENCED_NAME
SCOTT                          EMP
SQL> SY.

Similar Messages

  • How to find the common dimension tables used in Finance AR/PR and GL,

    Hi All,
    I need to find the common dimension table used in the Finance modules (AP,AR,PO,GL...), Since separate teams are working on populating each modules, and we need to find the dependency so that our loads shouldn’t impact others.
    Thanks!
    OBI

    Hi Guys,
    Thanks for all your answers.
    Yes....You are all right. We can list out the used tables upto certain extent. Anyhow, I have done some R&D to derive the SQL's which is given below:
    SELECT TABLE_NAME FROM USER_TABLES
    MINUS
    SELECT DISTINCT UPPER(REFERENCED_NAME)
    FROM user_dependencies
    where
    referenced_type='TABLE' and UPPER(NAME) in
    select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
    'MATERIALIZED VIEW',
    'PACKAGE',
    'PACKAGE BODY',
    'PROCEDURE',
    'TRIGGER',
    'VIEW',
    'FUNCTION'
    UNION
    SELECT UT.TABLE_NAME FROM
    SELECT TABLE_NAME FROM USER_TABLES
    MINUS
    SELECT DISTINCT UPPER(REFERENCED_NAME)
    FROM user_dependencies
    where
    referenced_type='TABLE' and UPPER(NAME) in
    select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
    'MATERIALIZED VIEW',
    'PACKAGE',
    'PACKAGE BODY',
    'PROCEDURE',
    'TRIGGER',
    'VIEW',
    'FUNCTION'
    AND REFERENCED_OWNER=(SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual)
    ) UT,
    ( SELECT * FROM USER_SOURCE
    WHERE NAME IN
    ( SELECT DISTINCT NAME FROM USER_SOURCE
    WHERE TYPE NOT IN ('TYPE')
    AND
    UPPER(TEXT) LIKE '%EXECUTE IMMEDIATE%'
    ) US
    WHERE
    UPPER(US.TEXT) LIKE '%'||UPPER(UT.TABLE_NAME)||'%'
    AND
    (UPPER(US.TEXT) NOT LIKE '%--%')
    The above SQL Query can list out unused tables by checking the Dynamic SQL Statement also upto some level only.
    Once we extracted the list of unused tables, having a manual check would be also greater to verify as it is should not impact the business applications.
    Regards,
    Subramanian G

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    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
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

  • How to find the Date and Time of Modification of Column in aTable?

    Hi all,
    Do  you know how to find the Date and Time of Addition of Column to a Particular Table?.
    I know however, How to find the modification time of the Table. Using the below Query :
    Select Object_Name, to_Char(Last_DDL_TIME, 'DD-Mon-YYYY HH24:MI:SS') Last_DDL from User_Objects where Object_Type = 'TABLE';
    Object_Name
    Last_DDL
    Employee
    20-Aug-2013 09:23:03
    I wanted to know the Creation or Modification Date and Timestamp of all columns of Employee Table?. Is it possible at all. If possible, How to get it?.
    Regards,
    Bhaskar M

    I agree with you on that. Since its a development enviornment I can remove the column but that not my point here.
    My whole purpose it to know whether we get the Column's Creation or Modification DateTime.

  • How to find the font and replace another font using javascript in illustrator?

    Dear All,
    how to find the font and replace another font using javascript [batch process] in illustrator?
    i have 700 image file, it very deficult replace one by one.
    regards,
    .Suresh.S

    Ask the creator of the file for a unprotected version.

  • Reg:How to delete the column in table control also from database table.

    Hi Experts,
    Once again thank u all for giving the responses.
    one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
    With Regards,
    Saroja.P.

    Hi,
    If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
    "This portion of code inside the LOOP...ENDLOOP.
    IF sy-ucomm eq 'F_DELETE'.
       gt_itab2-check = mark.  " Store the MARK field status into your internal table's correspoding field 'check'
      MODIFY gt_itab INDEX tabcontrol-current_line.
    ENDIF.
    iF sy-ucomm eq 'DELETE1'.
      DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
    ENDIF.
    Now you can modify your database table using the MODIFY statement.
    MODIFY ZDB FROM TABLE gt_itab.

  • How to find the header and item level status of a CRM contract ?

    Hi,
    Few questions
    A. How to find the header and item level status of a CRM contract ? My req is to select all the contract line items which are in CLOSED status.
    B. How to get the BPs associated with a contract ?
    Anyone have the list of CRM tables and the relation amongst them. Please mail me in [email protected]

    CRMD_ORDERADM_H     Contains the Header Information for a Business Transaction.
    Note:
    1.     It doesn’t store the Business Partner
           responsible for the transaction. To 
           get the Partner No, link it with
           CRM_ORDER_INDEX.
    2.     This table can be used for search
           based on the Object Id(Business
           Transaction No). 
    CRMD_CUSTOMER_H     Additional Site Details at the Header Level of a Business Transaction
    CRMD_LINK     Transaction GUID set for all the Business Transactions
    CRMD_ORDER_INDEX     Contains Header as well as Item details for a Business Transaction.
    Note:
    1.     It doesn’t store the Business 
          Transaction No (Object ID).
          To get the Business Transaction No  
          link the table with
          CRMD_ORDERADM_H
    2.   This table can be used for search
          based on the Partner No
    CRMD_ORDERADM_I     Stores the Item information for a Business Transaction. The scenarios where we have a Contract Header and within contract we have Line Items for the contract, this table can be useful.
    E.g. Service Contracts
    CRMD_CUSTOMER_I     Additional Site Details at the Item Level of a Service Contract
    Pl.reward points.......

  • How to find the average of table row values it should display in next row in libwindow/​CVI

    Hi,
    How to find the average of table row values it should display in next row in libwindow/CVI
    Please let me know the solution.

    There isn't a built-in function to perform calculations on thable cells. What you can do is to retrieve thable cells values and calculate the average by yourself.
    To retrieve a bunch of cells in a single instruction you can use GetTableCellRangeVals: prerequisite for this function to work correctly is that cells are all included in a Rect structure (shortly, a rectangle) and are all of the same data type. See the help for the function for some explanations and the link to an example of its usage. In Cell range parameter you can pass VAL_TABLE_ROW_RANGE (row) macro to retrieve an entire row. See here for details.
    Once you have retrieved cell values in an array, you can pass it to Mean function to calculate the average.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to find the CRM related Tables form a Particular DataSource

    Hi friends
               <b>How to find the CRM related Tables form a Particular DataSource
      of BusinessContent.</b>
      ex: i had taken CRM - DataSource ........ 0CRM_LEAD_H (Lead Header Data)
           for this DS i assign IS and extract data. But i want to Know from which
           CRM tables it was comming.
           ie ..I want to know the what tables linked to Datasource(0CRM_LEAD_H)
           How it has to check?

    Just for your info, you can find as useful (for a methodology to solve this kind of issue) this weblog:
    SAP BW and Business Content Datasources: in pursuit of the origins
    Hope it helps!
    Bye,
    Roberto

  • How to find max(time) from table using group by

    how to find max(time) from table using group by
    select var max(time)
              from table
              into (var1, time1)
               where .....
                 group by var.
    it is fetching record which is top in table.
    if u can help?
    regards.

    No this will fetch the maximum time from teh table.
    select var max(time)
    from table xxxx
    into (var1, time1)
    where .....
    group by var.
    Refer this code
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.

  • How to find the list of Tables....

    Hi
    How to find the list of Tables associated with When a Goods Issue is done for a Process Order ??
    Kindly tell me step-by-step procedure in browsing it.
    cheers
    MaruthiRam

    Hi
    goto SE16 Click F4, You have two options Information system & Sap Applications.
    Click on SAP Applications & selec the application you wnat to see, for E.g Purchasing you can click on materials managemnt, Purchasing if you drill down you will see the list of tables....
    reward points if useful
    Thanks & Regards
    Kiran

  • How to find the job and job status from RSPCM

    hi all,
    suppose we got an error and in rspcm the process was failed.i want to know the status of that particular job.and if any i want to stop that job in SM37.
    plz tell me how to find the job and job ststus from RSPCM...and how to stop that job in SM37
    thanks,
    jack

    Hi Jack,
    RSPCM: T.Code
    This transaction is used to monitor the process chains
    First:
    here you need to add the process chains into the sheet
    Second:
    Then you can monitor the process chains in this transaction code
    Like you can see the :  status ,proces chain ,Last run date ,Last run time ,Log ID
    Status : Green when sucessful,Yellow when running & Red when you get errors
    Now when yoy click on any of the process chain in RSPCM you will go to the LOG VIEW as you see in RSPC transaction
    SM37:T.code
    This transaction is used for Job Overview
    you can see many options in SM37
    like Released,active,cancelled,finished,etc
    Just select the ACTIVE  jobs and also pass STAR in JOB ID & USER ID
    here you can only see the active jobs
    Goto Step in toolbar
    select the program displayed
    then chose option GOTO - Variant in main menu bar
    in the variant you can see the job belong to which Process chain
    if you want to cancel this job come back to SM37 Display screen
    Select the Job and select the JOB DETAILS tab in Tool Bar
    Collect the WIP ( Work Permit ID)
    Go to SM50 T.code and find the WIP
    in Main Menu Bar you find the option Cancel with Core choose this it will cancel the Job
    Regards
    Hari

  • How to find the Project and wbs Element System Status

    Hi all,
      How to find the Project and wbs Element System Status.
      We can find the system status in the CJ20n transaction but I want the table and field name where it is stored.
    Regards
    Raghavendra

    Hi,
    try table <b>jest</b> with key = prps-objnr
    Andreas

  • How to find the count of tables going for fts(full table scan in oracle 10g

    HI
    how to find the count of tables going for fts(full table scan) in oracle 10g
    regards

    Hi,
    Why do you want to 'find' those tables?
    Do you want to 'avoid FTS' on those tables?
    You provide little information here. (Perhaps you just migrated from 9i and having problems with certain queries now?)
    FTS is sometimes the fastest way to retrieve data, and sometimes an index scan is.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
    There's no 'FTS view' available, if you want to know what happens on your DB you need, like Anand already said, to trace sessions that 'worry you'.

  • How to hide the Columns and Views for Login user in SharePoint 2013

    Hi Friends,
    How to hide the Columns and Views for Login user in SharePoint 2013? Is it possible using OOB features? If not possible how can we hide the Columns and Views for Login user?
    Could you please help on this.
    Thanks,
    Tiru
    Tiru

    Hello Tirupal,
    There is no OOB way to do this.
    Please check this codeplex solution to achieve the same.
    https://sp2013columnpermission.codeplex.com/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

Maybe you are looking for

  • Error in Running a Page in Jdeveloper through VPN

    I am having an issue running a Hello World Page in JDeveloper9i through VPN. When I try to run a page, web browser is trying to open the page based on the Host Name or IP Address used to refer to Embedded OC4J. It would be really great if you could h

  • Indian iphone cannot be used in Germany

    I purchased IPhone in India through retail mobile store and I was using airtel postpaid in India. Now I am in Germany for business trip and I cannot use Lyca mobiles sim because it is asking for activation. When i enquired the same in the mobile shop

  • Regarding vendor registration

    Hi All, I have a reporting requirement in which I need to display the name of the vendor,its current registration status(whether its new,accepted or rejected),and the date of its registration. Plaese guide me what should I do on the modelling side. P

  • ADC Apple monitor compatible with MacPro?

    will my Apple Cinema Display (20-inch) ADC connector work with the new MacPro?

  • Illustrator 4 missing plug-ins after updating to yosemite

    I am a freelance illustrator and use illustrator 4 everyday. I recently updated my mac to OS X Yosemite, now i find that whenever i open a file created in illustrator that has a bitmap tif from photoshop placed in it comes up with the error message "