Re: Retrieve case sensitive tables

From: Ken Denny <ken_at_kendenny.com>
Date: Mon, 7 Jan 2008 10:20:19 -0800 (PST)
Message-ID: <9e8e5b37-b1c5-43fb-a207-5c6f20d1d5d0@u10g2000prn.googlegroups.com>


On Jan 7, 12:27 pm, abbe..._at_gmail.com wrote:
> Hello,
>
> I'm trying to retrieve a list of tables from all_tables in a given
> Oracle db. I'm using the .NET provider (by Microsoft) and I always
> obtain the results in uppercase. The problem is that some tables where
> defined in "Mixed/Case" so when I retrieve the list I need to obtain
> the exact case used when they were created. Do you know how can I
> achieve this?
>
> Thank-you.
> Abbeyro

I'm pretty sure your table names are all upper case. If the table names were mixed case all_tables would have the names in mixed case. You can use the command: CREATE TABLE Tab_1A but unless you put double quotes around the table name the table will be created with the name all upper case (TAB_1A). If you want the table name to be mixed case then you must use double quotes around the table name: CREATE TABLE "Tab_1A"

SQL> create table Tab_1A (x varchar2(1));

Table created.

SQL> select table_name from all_tables where table_name like '%1A';

TABLE_NAME



TAB_1A SQL> create table "Tab_1A" (x varchar2(1));

Table created.

SQL> select table_name from all_tables where table_name like '%1A';

TABLE_NAME



Tab_1A
TAB_1A Received on Mon Jan 07 2008 - 12:20:19 CST

Original text of this message