table name in uppercase

Posted on 2011-05-09
Last Modified: 2012-05-11
If there a query that i can write that will return the results from either of the query whichever returns rows. The character case of the table name could be in any case and not known to me at design time.

select COLUMN_NAME from all_tab_columns where TABLE_NAME='abcdefg'

select COLUMN_NAME from all_tab_columns where TABLE_NAME='ABCDEFG'

or any other case like 'Abcdefg' or 'AbCdEfg'

this query is to be run in oracle and sybase DBs

Question by:PearlJamFanatic
    LVL 23

    Expert Comment

    - in Oracle you can use UPPER or LOWER to forced the data to be in uppercase/lowercase

    select COLUMN_NAME from all_tab_columns where UPPER(TABLE_NAME) = UPPER('abcdefg')
    LVL 23

    Assisted Solution

    - to add, the UPPER() function converts all letters in both the column data and the passing variable thus forced both data to be in uppercase regardless of their original case format.
    LVL 31

    Accepted Solution

    See attached.
    LVL 26

    Assisted Solution

    In Sybase, you can do:

    select from syscolumns c, sysobjects o where = and upper( = upper('whatever')

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
    This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now