Finding column,table names in a schema with search data

Hi All,
I want to list all the columns,tables in a schema with any search value.
Ex: Take an example of EMP table, if I search with 'MARTIN', result should be ename (column name) , emp(table name).
Can you please help me on this regard to write a query.
Regards,
Rajasekhar

SQL> set line 1000
SQL> VAR val VARCHAR2(30)
SQL> execute :val:='SMITH';
PL/SQL procedure successfully completed.
SQL> SELECT   DISTINCT
  2               SUBSTR(:val, 1, 11) "Searchword",
  3               SUBSTR(table_name, 1, 14) "Table",
  4               SUBSTR(t.COLUMN_VALUE.getstringval(), 1, 50) "Column/Value"
  5  FROM     cols,
  6               table(XMLSEQUENCE(DBMS_XMLGEN.getxmltype(   'select '
  7                                                        || column_name
  8                                                        || ' from '
  9                                                        || table_name
10                                                       || ' where (UPPER('''
11                                                       || :val
12                                                       || ''')=UPPER('
13                                                       || column_name
14                                                       || '))').EXTRACT('ROWSET/ROW/*'))) t
15  WHERE    table_name IN ('EMP', 'DEPT','EMPLOYEES') --limiting the table names, you can omit this.
16  ORDER BY "Table";
Searchword                                   Table                                                    Column/Value
SMITH                                        EMP                                                      <ENAME>SMITH</ENAME>
SMITH                                        EMPLOYEES                                                <LAST_NAME>Smith</LAST_NAME>

Similar Messages

  • Using column value is it possible to find the table name in the database?

    Hi all,
    using column value is it possible to find the table name in the database?
    guys i need the table value
    Note:
    oracle-9i
    for example:
    i don't know NIC(column value) in which table in the database.
    Thank you,
    with regards,
    JP.
    Edited by: Guest on Feb 27, 2012 5:42 AM

    Hi,
    As far as I understand what you are asking for I would suggest 4 data dictionaries that will help you to know the table name from the column names
    1. USER_TAB_COLS
    2. ALL_TAB_COLS
    3. DBA_TAB_COLS
    4. COLS
    These can give you detail information about the columns and respective tables at user, schema, dba level. Further information on the table can be found by querying ALL_OBJECTS table giving table_name as Object_name, or you can join the data dictionaries too.
    To know about various data dictionaries avalible in Oracle please query select * from cat;
    Let us know if you need further assistance.
    Twinkle

  • To find a table name where the field is from??

    Hi Friends...
    I know the field name and now how can I find the table name to which the field belongs....
    Points will be surely awarded...
    Thanks

    Hi,
    To know the master table for the field:
    Go to se11 and give ur field name in the data type selecttion and click on Display.
    Double click on Domain. Goto Value range tab page. In the bottom you can see Value table.
    With rgds,
    Anil Kumar Sharma .P

  • Viewing all Table names in my schema

    I have lost track of what tables I have created in for my database. I can't find in the SQL documentation where the
    command is to show all the table names in my schema.
    Thanks so much
    Nick

    Or you can pause the output :
    SQL> set pages 24 
    SQL> set pause on
    SQL> set pause "Press Enter " 
    SQL> select * from tab;http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1011230

  • Regarding finding the table name for a field in R12 forms

    Hi all,
    I need to know how to find the table name for a field in R12. I am working on extracting the employee information but i need to know how to get the table names for the fields.
    Thank you,
    raj

    Please see these threads.
    How to find table name in ebs
    How to find table name in ebs
    E-Business tables
    E-Business tables
    Thanks,
    Hussein

  • Table name for Invoice created with PO ref

    hi,
    I required Table name for Invoice created with PO ref.
    Regards,
    Ali

    HI,
    Check the table RSEG: Document Item: Incoming Invoice
    Look for the fields BELNR and EBELN
    Regards
    KK

  • Table name for sales order with Customer info

    Hi Gurus,
    Could you please provide me table name for  sales order with customer no and customer name.
    I have list of sales order number (more than 1000 no's ) i need to identify customer number and customer name (ship to party and sold to party information). I am running this report every week. so i plan to create sqvi for this report.
    Thanks and regards,
    B.Deethya.

    Hello,
    Access Tables VBAK & VBAP.
    From the above tables you will get Solt to Party & Ship to Party Codes.
    For Customer names you have to pass the Customer Codes to Table - KNA1
    Hope this clarifies.
    Thanks,
    Jignesh Mehta

  • Find Transparent table name for correspoding Dictionary Structure SRM 7.0

    Hi,
    I am not able to find Transparent table name for correspoding Dictionary Structure in Webdynpro Component for a field in  SRM 7.0.
    Please let me know.
    Thanks,
    Monica

    Hi Monica
    please tell the transaction name and the name of field seen in webdynpro
    regards
    andrea

  • Mixed case in column & table name

    Hi,
    How can tell SQL to use mixed case for column & table name?
    For example:
    create table PerNode (netId number, nodeId number);
    select netId, nodeId from PerNode;
    The above statements automatically made to upper case. But I wanted to retain the case sensitiveness in the column & table names.
    I know a way by including the names in double quote in the case will make this to retain the case.
    But I don't want to give all the time the column & table names within double quote.
    What I wanted to know is that is there any ALTER kind of statement will make the SQL to use the case I use in the name of the column & table.
    I greatly appreciate your advice.
    Thanks,
    --JK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Oracle column names and table names are case insensitive unless you enclose them in quotes.
    Unless you want to have two tables, one called PerNode and one called pernode or some such, I'm not sure what benefit case sensitivity would have. One can certainly use mixed case SQL statements in stored procedures and ad-hoc SQL for readability-- only in the Oracle internals is everything changed to upper case.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com/askDDBC

  • Table name should be concatenated with month & year eg.product_may09

    hello all,
    I have to take a backup of table on monthly basis. for this table name should be concatenated with previous month and year eg., product_may09.. I tried with Create table stmnt its not working anyone please help.

    It would be very generous from you if you would provide us with versions, what you did and what's not working (maybe an error message?)...
    Anyway; If I got you right you want to create a backup table with the same structure and data as in your base table?
    maybe this:
    forms_ddl('create table product_'||to_char(sysdate, 'monyy')||' as select * from product');fits your requirement. This creates you a table with the same structure and data as your basetable (except the primary/foreign keys, indices and trigger you have on the basetable).
    But if you have to do this every month by hand I'd go for a database job which runs once a month with the above statement. In database procedures you have to use execute immediate instead of forms_ddl; usage is the same (except execute immediate raises intelligent exceptions in contrary to forms_ddl). take a look at http://tahiti.oracle.com and search after dbms_job or dbms_scheduler (depending the database version you use which you also didn't mention)
    regards

  • Find the table names in a package body

    How to find the table names in a package body in single query .(SQL).

    Hi,
    you can find dependent objects of a package from below query
    select distinct referenced_name ,REFERENCED_TYPE from ALL_DEPENDENCIES where name = 'PACKAGE' and  referenced_owner not in ('SYS','PUBLIC') and referenced_type = 'TABLE';
    Thanks
    Handle: user12057782
    Status Level: Newbie
    Registered: Oct 13, 2009
    Total Posts: 5
    Total Questions: 4 (4 unresolved)
    mark answered if helpful/correct
    Edited by: CKPT on Nov 22, 2010 1:21 PM

  • I want to find the table name

    Hi experts,
    I want to find information which is stored in the particular transaction (find the table name)
    tcode is COR3 in that enter process order and enter after that go to adminstrative data in that created user.
    I want find user information will be stored in which table . pls help me in this

    Hi,
    There are both technical and functional ways of knowing the Table Names:
    1. You can ask your functional consultant to give you the basic or the main table name. From there you can use a where used list to get the list of all the tables that are connected to this table by the foreign key relationship.
    2. You can get to know the name of the package from the package hierarchy. You can also use se84 to find the objects from the repository information browser.
    3. You can use the ST05 transaction to run and SQL trace to find all the tables that where accessed during the TCODE execution. But here you need to be precise as it will show you all the names of all the database tables accessed.
    Hope this will help you.
    Thanks,
    Samantak.

  • How can one find the table name of the Delta Que and setup table?

    Hi !
    Is there any method to find the table name of the delta que and Extraction que ?

    setup table = <extract structure>_setup
    example: setup table for MC11VA0ITM = MC11VA0ITM_SETUP
    Delta Queue is based on following 3 tables:
    ARFCSDATA
    ARFCSSTATE
    TRFCQOUT
    assign points if useful ***
    Thanks,
    Raj

  • What is the table name for getting Last Receipt  & issue date of material?

    Hi Friends,
    What is the table name for getting Last Receipt  & issue date of material?
    *Case 1:*
    Here, I am running report in May 2008. But, if there is no goods receipt for the respective material since last 13th March 2007.
    Then in this case Last goods receipt date should be 13th March 2007.
    Please guide me.
    Regards
    Siva

    I checked MSEG table. But, I didn't find any field for date.
    Can you tell me field name.
    Regards
    Siva

  • How to find the list of un used table names in a schema?

    Hi,
    I have a doubt in Oracle. The doubt is that If we are using any tables in Function Or Proc.... Then...We can list all those used table names from USER_DEPENDENCIES system table. Right...
    But, If the table is used with Execute Immediate Statement, then, those table names are not coming out with USER_DEPENDENCIES system table. Because they are identified at run time and not compile time.
    It is fine. And I agree.. But, If I want to list out those tables also...then...How to do? Any idea?
    I think ‘USER_SOURCE’ system table may not be the right one. If there is any other system table avails for this purpose...then..it would be very grateful to extract right...
    So I am wanting that exact system table.
    Please let me know about this, if you have any idea or check with your friends if they have any idea.
    Regards,
    Subramanian G

    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

Maybe you are looking for