Query to list tables with a particular column name in a schema!!

Is there any way to know?
Thanks in advance.

You can query the data dictionary views to get this information.
For example
untested
select table_name
from user_tab_columns
where column_name = 'my particular column name';There is also all_tab_columns and dba_tab_columns. Both of which would include the schema name.
Edited by: Sven W. on Sep 9, 2011 2:24 PM

Similar Messages

  • Items in project report(query) are listed under the "not assigned" (column)

    Hi All,
    Items in project reports (query) are listed under the "not assigned" (column name) Why it is so ?
    Start query : project reports & ask for period April 2008 (Period from/to). .
    You will see items listed under  Not assigned WBS Element (column name)
    If you choose for a period of April until June 2008 then you see more items under u201Cnot assignedu201D .
    Items should be under Assigned (column name) & not under the Not assigned (column name )
    Any suggestions highly appreciable.
    Thanks.

    Hi,
    How are you displaying the ITEM field in the BEx query designer? Is it displayed with "Key and Text"? If so and if the text is not loaded for this master, this may happen.
    Regards,
    Yogesh.

  • What index is suitable for a table with no unique columns and no primary key

    alpha
    beta 
    gamma
    col1
    col2
    col3
    100
    1
    -1
    a
    b
    c
    100
    1
    -2
    d
    e
    f
    101
    1
    -2
    t
    t
    y
    102
    2
    1
    j
    k
    l
    Sample data above  and below is the dataype for each one of them
    alpha datatype- string 
    beta datatype-integer
    gamma datatype-integer
    col1,col2,col3 are all string datatypes. 
    Note:columns are not unique and we would be using alpha,beta,gamma to uniquely identify a record .Now as you see my sample data this is in a table which doesnt have index .I would like to have a index created covering these columns (alpha,beta,gamma) .I
    beleive that creating clustered index having covering columns will be better.
    What would you recommend the index type should be here in this case.Say data volume is 1 milion records and we always use the alpha,beta,gamma columns when we filiter or query records 
    what index is suitable for a table with no unique columns and primary key?
    col1
    col2
    col3
    Mudassar

    Many thanks for your explanation .
    When I tried querying using the below query on my heap table the sql server suggested to create NON CLUSTERED INDEX INCLUDING columns    ,[beta],[gamma] ,[col1] 
     ,[col2]     ,[col3]
    SELECT [alpha]
          ,[beta]
          ,[gamma]
          ,[col1]
          ,[col2]
          ,[col3]
      FROM [TEST].[dbo].[Test]
    where   [alpha]='10100'
    My question is why it didn't suggest Clustered INDEX and chose NON clustered index ?
    Mudassar

  • Cartesian of data from two tables with no matching columns

    Hello,
    I was wondering – what’s the best way to create a Cartesian of data from two tables with no matching columns in such a way, so that there will be only a single SQL query generated?
    I am thinking about something like:
    for $COUNTRY in ns0: COUNTRY ()
    for $PROD in ns1:PROD()
    return <Results>
         <COUNTRY> {fn:data($COUNTRY/COUNTRY_NAME)} </COUNTRY>
         <PROD> {fn:data($PROD/PROD_NAME)} </PROD>
    </Results>
    And the expected result is combination of all COUNTRY_NAMEs with all PROD_NAMEs.
    What I’ve noticed when checking query plan is that DSP will execute two queries to have the results – one for COUNTRY_NAME and another one for PROD_NAME. Which in general results in not the best performance ;-)
    What I’ve noticed also is that when I add something like:
    where COUNTRY_NAME != PROD_NAME
    everything is ok and there is only one query created (it's red in the Query plan, but still it's ok from my pov). Still it looks to me more like a workaround, not a real best approach. I may be wrong though...
    So the question is – what’s the suggested approach for such queries?
    Thanks,
    Leszek
    Edited by xnts at 11/19/2007 10:54 AM

    Which in general results in not the best performanceI disagree. Only for two tables with very few rows, would a single sql statement give better performance.
    Suppose there are 10,000 rows in each table - the cross-product will result in 100 million rows. Sounds like a bad idea. For this reason, DSP will not push a cross-product to a database. It will get the rows from each table in separate sql statements (retrieving only 20,000 rows) and then produce the cross-product itself.
    If you want to execute sql with cross-products, you can create a sql-statement based dataservice. I recommend against doing so.

  • Query on a table with indexed date field

    I have a table with a date column which is indexed. If I run a query like "select column1 where date_field='20-JAN-04' for example it is fast and uses index.
    If I run select column1 where date < '20-JAN-04' it is slow and doesnt use the index. I logged a TAR and Oracle told me that this is to be expected as not using the index in this case is the most effiecient way of doing the query.
    Now my concept of an index is like the index of Yellow Pages(telephone directory) for example. In this example if I look for a name that is say "Halfords" or below, I can see all entries for Halfords and all the way to ZZZ in one block.
    I just cant see , in a common sense way why Oracle wont use the index in this type of query.
    George

    Using the concept of a telephone directory is wrong. In a telephone directory you have all information order by the name. However in your table (if it is not an IOT) you don't have all information/rows ordered by your date_field. Rather think at the document "Oracle9i Database Concepts" and it's index.
    Let's say you want to find all indexed words larger then "ISO SQL standard" (ok that doesn't make sense but it is just an example). So would it be faster to read the whole document or to lookup each word in the index and then read the entire page (Oracle block) to find the word.
    It's not allways easy to know in advance if the query will be faster over the index or a full table scan. what you need to do is to well analyze (dbms_stats) the table and it's index, in most cases Oracle chooses the right way. You may also use the hint /*+ index(table_name index_name) */ and will see if it would be faster over the index or not.
    A good document about that subject is:
    http://www.ioug.org/tech/IOUGinDefense.pdf
    HTH
    Maurice

  • Optimise query on the table which contain 1000 column

    Hi ,
    I have query on the table which contain 1000 columns
    when i am executing query on same table .It is taking time .
    Select * from abc
    where col1 between start_date and end_date ;
    abc table contain 1000 columns.
    please tell me how to optimise query

    Yeah, that was my thought as well ... 1000 columns? wtf?
    I can't think of many reasons for why you'd need to do a select * on it, and the scenarios that would require that are better addressed at the DBA level, perhaps using db replication and the data pump, etc. So to start with try selecting just the data you would need.
    One thing you can do right off the bat is to partition that table by date, and also to analyze and run statistics on it (this was a nightly operation at my last job).
    You can also create a materialzed view that refreshes overnight, just on the slice of the data you need. Use a forced fast refresh to make it current before you use it.

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

  • Importing a table with a BLOB column is taking too long

    I am importing a user schema from 9i (9.2.0.6) database to 10g (10.2.1.0) database. One of the large tables (millions of records) with a BLOB column is taking too long to import (more that 24 hours). I have tried all the tricks I know to speed up the import. Here are some of the setting:
    1 - set buffer to 500 Mb
    2 - pre-created the table and turned off logging
    3 - set indexes=N
    4 - set constraints=N
    5 - I have 10 online redo logs with 200 MB each
    6 - Even turned off logging at the database level with disablelogging = true
    It is still taking too long loading the table with the BLOB column. The BLOB field contains PDF files.
    For your info:
    Computer: Sun v490 with 16 CPUs, solaris 10
    memory: 10 Gigabytes
    SGA: 4 Gigabytes

    Legatti,
    I have feedback=10000. However by monitoring the import, I know that its loading average of 130 records per minute. Which is very slow considering that the table contains close to two millions records.
    Thanks for your reply.

  • How to create table with rows and columns in the layout mode?

    One of my friends advised me to develop my whole site on the
    layout mode as its better than the standard as he says
    but I couldnot make an ordinary table with rows and columns
    in th layout mode
    is there any one who can tell me how to?
    thanx alot

    Your friend is obviously not a reliable source of HTML
    information.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Mr.Ghost" <[email protected]> wrote in
    message
    news:f060vi$npp$[email protected]..
    > One of my friends advised me to develop my whole site on
    the layout mode
    > as its
    > better than the standard as he says
    > but I couldnot make an ordinary table with rows and
    columns in th layout
    > mode
    > is there any one who can tell me how to?
    > thanx alot
    >

  • Tabular Form based on table with lots of columns - how to avoid scrollbar?

    Hi everybody,
    I'm an old Forms and VERY new APEX user. My problem is the following: I have to migrate a form application to APEX.
    The form is based on a table with lots of columns. In Forms you can spread the data over different tab pages.
    How can I realize s.th similar in APEX? I definitely don't want to use a horizontal scroll bar...
    Thanks in advance
    Hilke

    If the primary key is created by the user themselves (which is not recommended, you should have another ID which the user sees which would be the varchar2 and keep the primary key as is, the user really shouldn't ever edit the primary key) then all you need to do is make sure that the table is not populated with a primary key in the wizard and then make sure that you cannot insert a null into your varchar primary key text field.
    IF you're doing it this way I would make a validation on the page which would run off a SQL Exists validation, something along the lines of
    SELECT <primary key column>
    FROM <your table>
    WHERE upper(<primary key column>) = upper(<text field containing user input>);
    and if it already exists, fire the validation claiming that it already exists and to come up with a new primary key.
    Like I said if you really should have a primary key which the database refers to each individual record itself and then have an almost pseudo-primary key that the user can use. For example in the table it would look like this:
    TABLE1
    table_id (this is the primary key which you should NOT change)
    user_table_id (this is the pretend primary key which the user can change)
    other_columns
    etc
    etc
    hope this helps in some way

  • Difference between an XMLType table and a table with an XMLType column?

    Hi all,
    Still trying to get my mind around all this XML stuff.
    Can someone concisely explain the difference between:
    create table this_is_xmltype_tab of xmltype;and
    create table this_is_tab_w_xmltpe_col(id number, document xmltype);What are the relative advantages and disadvantages of each approach? How do they really differ?
    Thanks,
    -Mark

    There is another pointer Mark, that I realized when I was thinking about the differences...
    If you would look up in the manual regarding "xdb:annotations" you would learn about a method using an XML Schema to generate out of the box your whole design in terms of physical layout and/or design principles. In my mind this should be the preferred solution if you are dealing with very complex XML Schema environments. Taking your XML Schema as your single point design layout, that during the actual implementation automatically generates and builds all your needed database objects and its physical requirements, has great advantages in points of design version management etc., but...
    ...it will create automatically an XMLType table (based on OR, Binary XML of "hybrid" storage principles, aka the ones that are XML Schema driven) and not AFAIK a XMLtype column structure: so as in "our" case a table with a id column and a xmltype column.
    In principle you could relationally relate to this as:
    +"I have created an EER diagram and a Physical diagram, I mix the content/info of those two into one diagram." "Then I _+execute+_ it in the database and the end result will be an database user/schema that has all the xxxx amount of physical objects I need, the way I want it to be...".+
    ...but it will be in the form of an XMLType table structure...
    xdb:annotations can be used to create things like:
    - enforce database/company naming conventions
    - DOM validation enabled or not
    - automatic IOT or BTree index creation (for instance in OR XMLType storage)
    - sort search order enforced or not
    - default tablenames and owners
    - extra column or table property settings like for partitioning XML data
    - database encoding/mapping used for SQL and binary storage
    - avoid automatic creation of Oracle objects (tables/types/etc), for instance, via xdb:defaultTable="" annotations
    - etc...
    See here for more info: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#ADXDB4519
    and / or for more detailed info:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#i1030452
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#i1030995
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#CHDCEBAG
    ...

  • Finding a TABLE based on a COLUMN NAME...

    I need to find all tables that that have a common column name.
    Upon searching the Forum, I found this nice nugget:
    How to find the table in a schema if I only know a particular column name
    The problem is, my USER_TAB_COLUMNS is EMPTY!
    If it had worked, then my statement would be:
    select * from USER_TAB_COLUMNS
    where COLUMN_NAME LIKE '%TEST%'
    and OWNER='ME';
    I get "no rows selected" (though I know they exist)
    if I do:
    select * from USER_TAB_COLUMNS
    I also get "no rows selected"
    Any ideas!
    Thanks!
    KSL.

    The user_xxx data dictionary tables show all of the whatevers that are owned by the logged in user. So, if you are logged in as user1 the user_tab_columns view will only show tables and views owned by user1.
    The all_xxx dictionary views show all of the whatevers that the logged in user has access to. so if you are logged in as user1 and user2 gave you selet privileges on tablea, then you would see tablea in all_tab_columns.
    The dba_xxx views show all objects in the database, but are generally only available to privileged users.
    If you have access to the dba_views, try:
    SELECT owner, object_type
    FROM dba_objects
    WHERE UPPER(object_name) = 'ANL'It is possible that the table and or its columns were created with double quotes so are case sensitve. It may also be a synonym, pointing to one of the tables that you got form your query.
    If you are only using all_tab_columns then it is possible that the user you are logged in as does not have privileges on the table anl so would not see it in the view.
    A long shot, but are you sure you are in the right database?
    John

  • How to create list of a View's column names and source

    Using SQL 2005, 2008, and 2012
    How to create list of a View's column names and source. For the following example would like to @Print something like the following.  Does anyone already have some code to do this? I realize there are probably some gotchas, but the views that I am looking
    at to use this follows the code snippet pattern below.
    DBACCT.[Account Number]
    dbo.ConvertDate(DBACDT). [Boarding Date]
    DBXES.DBXES
    CREATE VIEW [dbo].[v_ods_DBAL]
    AS
    SELECT DBACCT AS [Account Number], dbo.ConvertDate(DBACDT) AS [Boarding Date], DBXES
    FROM dbo.ods_DBAL

    The column information can be obtained from INFORMATION_SCHEMA.COLUMNS view using logic like below
    SELECT c.COLUMN_NAME,c.DATA_TYPE
    FROM INFORMATION_SCHEMA.COLUMNS c
    WHERE EXISTS (SELECT 1
    FROM INFORMATION_SCHEMA.TABLES
    WHERE TABLE_NAME = c.TABLE_NAME
    AND TABLE_TYPE='VIEW')
    http://technet.microsoft.com/en-us/library/ms188348.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • MS Access DB with Spaces in Column Name

    Good Afternoon-
    I'm having some serious headaches with a table that I need to extract information from. The powers that be wrote it with the following column names "Contract Number" , "Customer Number", "Description".
    Note the spaces in the columns.
    Sample code from here: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2691&lngWId=2
    I'm using sample code for connecting to the database and I can access everything using the select statements, except if the column contains a space. I get the following errors:
    s.execute("select [Customer Number], Name from Customer");
    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    s.execute("select \"Customer Number\", Name from Customer");
    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    s.execute("select Customer*Number, Name from Customer");
    Error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
    s.execute("select 'Customer Number' , Name from Customer");
    Data from column_name: Customer Number , Unknown
    This works, but would require parsing-
    s.execute("select * from Customer");
    Data from column_name: 5 , Unknown
    Suggestions would be truly appreciated.
    Jason

    "select [Customer Number] , Name from Customer " ;
    returned the correct responses.Double quoted identifiers, which is part of ANSI SQL should have solved it....
    "select \"Customer Number\" , Name from Customer " ;
    As mentioned above it has certainly been my experience that DBAs (those with that title) all insist that quoted identifiers should never be used. Thus refactoring the database identifiers is actually the correct solution.

  • Query 4 joined tables with internal joins to represent a complex hierarchy!

    I've got to refine/replace a query (Oracle 9i) that
    currently joins rows from four tables in a hierarchical
    fashion that I use to produce a listing like this:
    agency abc 1
    ....division def 1.1
    ........service ghi 1.1.1
    ........service jkl 1.1.2
    ............faq mno 1.1.2.1
    ............faq pqr 1.1.2.2
    ........service stu 1.1.3
    ....division vwx 1.2
    ........service yyy 1.2.1
    ............faq zzz 1.2.1.1
    The change involves allowing for unlimited levels of
    nested child divisions to produce a listing like this:
    agency abc 1
    ....division def 1.1
    ........service ghi 1.1.1
    ........service jkl 1.1.2
    ............faq mno 1.1.2.1
    ............faq pqr 1.1.2.2
    ........service stu 1.1.3
    ....division vwx 1.2
    ........division xxx 1.2.1
    ............division aaa 1.2.1.1
    ............division bbb 1.2.1.2
    ................service aaa 1.2.1.2.1
    ....................faq fff 1.2.1.2.1.1
    ....................faq ggg 1.2.1.2.1.2
    ........service yyy 1.2.1
    ............faq zzz 1.2.1.1
    Notice the insertion of three nested divisions under
    division 1.2 with services and faqs under those. The
    order of names throughout is alphabetic within a nesting
    level.
    Here's the SQL I currently use, without nested divisions
    (it contains extra info that I use to control what and
    how names are displayed):
    SELECT
    agency.agency_id AGENCY_ID,
    agency.agency_type_id AGENCY_TYPE_ID,
    agency.name AGENCY_NAME,
    agency.acronym AGENCY_ACRONYM,
    agency.expiration_date AGENCY_EXP,
    agency.post_count AGENCY_POST,
    agency.stat AGENCY_STAT,
    agency_type.agency_type AGENCY_TYPE,
    division.division_id DIV_ID,
    division.name DIV_NAME,
    division.transfer_number DIV_TRANS_NUM,
    division.expiration_date DIV_EXP,
    division.post_count DIV_POST,
    division.stat DIV_STAT,
    service.service_id SVC_ID,
    service.name SVC_NAME,
    service.taxonomy SVC_TAX,
    service.keywords SVC_KEYWORDS,
    service.action_type SVC_ACTION_TYPE,
    service.sr_form_name SVC_SR_FORM,
    service.expiration_date SVC_EXP,
    service.post_count SVC_POST,
    service.stat SVC_STAT,
    faq.faq_id FAQ_ID,
    faq.name FAQ_NAME,
    faq.expiration_date FAQ_EXP,
    faq.post_count FAQ_POST,
    faq.stat FAQ_STAT
    FROM
    agency,
    agency_type,
    division left join service on
    division.division_id=service.division_id left join
    faq on service.service_id=faq.service_id
    WHERE (
    (agency_type.agency_type_id = agency.agency_type_id)
    AND (agency.agency_id = division.agency_id)
    AND (agency.agency_id = :agency_id )
    It's very fast -- I can retrieve and display 5,000 rows
    in seconds using Perl DBI and CGI -- and very easy to use
    to produce the hierarchical listing of items from the
    four tables. It is also very straightforward since I was
    able to generate the SQL using the SQL modeler in TOAD
    (I'm not the strongest SQL developer so I resort to
    tools).
    I need to get jump-started in the right direction to
    determine what I need to add to my division table
    (div_parent_id?), if I need a div_parent_child table to
    define the relationships (rows with parent_id & child_id
    pairs), and how to change or rewrite the SQL query. The
    CGI form that will be used to define the relationships
    will ask users to define children of a given division. I
    envision presenting a list of divisions with null
    parent_division_id columns for users to select from then
    updating selected rows for selected divsions.
    Thanks in advance for any help/guidance!
    -Gene

    INLINE VIEWS!
    select whatever_you_want
    from (
    SELECT FOLDER_ID, PARENT_FOLDER_ID, FOLDER_NAME
    FROM FOLDERS
    START WITH PARENT_FOLDER_ID = 0 CONNECT BY PARENT_FOLDER_ID = PRIOR FOLDER_ID
    ) tree, FILES
    where tree.folder_id = files.folder_id -- or something like that
    always try to keep the CONNECT BY limited to ONE AND ONLY table. then use that query in a subquery, a WITH clause, an inline view or something. do not try to JOIN or UNION with a CONNECT BY. it won't work the way you think it will, and even it returns the expected results, it will perform terribly.
    * your mileage may vary
    Message was edited by:
    shoblock
    added exclamation marks to show my excitement!!!!

Maybe you are looking for

  • How do I move data from my iphone to a new iMac?

    I just purchased a new iMac. I would like to move all data (music, apps, etc.) from my iPhone to the new iMac - how do I do that? Also, I have an old iMac that is no longer working but was one of the 5 computers that I had authorized for sharing musi

  • Bug in Apex 2.2.1.00.04 in overload call of function?

    We are having custom table defined as: CREATE TABLE HTMLDB_USERS (   ID             INTEGER               CONSTRAINT HTMLDB_USERS_ID_NN NOT NULL,   USERNAME       VARCHAR2(64 BYTE)     CONSTRAINT HTMLDB_USERS_USERNAME_NN NOT NULL, desc htmldb_users N

  • Ipod not getting recognized by computer or itunes

    okayyyy so after my ipod wiping i connected it to my pc and it was like the ipod's in recovery mode you've got to reformat etc. so i clicked the reformat button but my internet didn't work so i switched pc's to my brother's (same op system) but then

  • Not all Prefixes in VRF Tables are Reachable?

    Hello, During my studies with an MPLS VPN [MP-BGP] lab I found something unexpected.  I wonder if I am mistaken in my comprehension or if this normal: Not all prefixes in a VRF Table are pingable/reachable ? Seems that in the standard routing tables,

  • Imac freezes up but mouse still works

    I've got an imac with Snow Leopard on it.  It has started to freeze up quite a bit, maybe once every two days.  There are four profiles on the computer and it happens to them all.  I have reparied permissions in each profile and run the Hardware test