Case-sensitive table names

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Case-sensitive table names

Ivo Kulms
Hi there,

Is it possible in sqlite to work with case-sensitive table- and column
names?

(Sorry if this has been already answered somewhere in the documentation, but
I did not seem to find it.)

Cheers,
ivo




Reply | Threaded
Open this post in threaded view
|

Re: Case-sensitive table names

Austin Ziegler
On 9/28/05, Ivo Kulms <[hidden email]> wrote:
> Hi there,
>
> Is it possible in sqlite to work with case-sensitive table- and column
> names?
>
> (Sorry if this has been already answered somewhere in the documentation, but
> I did not seem to find it.)

Fortunately, sqlite is (mostly) standards based and if you want this
particular abomination, you put your table and column names in double
quotes.

SELECT "SillyColumn"
  FROM "SillyTable"

-austin
--
Austin Ziegler * [hidden email]
               * Alternate: [hidden email]
Reply | Threaded
Open this post in threaded view
|

AW: Case-sensitive table names

Ivo Kulms

Sorry, I was a little bit unclear.

My problem is that I have the need to treat "table1" and "TABLE1" as two
single entities.

ivo
 

-----Urspr√ľngliche Nachricht-----
Von: Austin Ziegler [mailto:[hidden email]]
Gesendet: Mittwoch, 28. September 2005 16:21
An: [hidden email]; [hidden email]
Betreff: Re: [sqlite] Case-sensitive table names

On 9/28/05, Ivo Kulms <[hidden email]> wrote:
> Hi there,
>
> Is it possible in sqlite to work with case-sensitive table- and column
> names?
>
> (Sorry if this has been already answered somewhere in the
> documentation, but I did not seem to find it.)

Fortunately, sqlite is (mostly) standards based and if you want this
particular abomination, you put your table and column names in double
quotes.

SELECT "SillyColumn"
  FROM "SillyTable"

-austin
--
Austin Ziegler * [hidden email]
               * Alternate: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Case-sensitive table names

Austin Ziegler
On 9/28/05, Ivo Kulms <[hidden email]> wrote:
> Sorry, I was a little bit unclear.
>
> My problem is that I have the need to treat "table1" and "TABLE1" as two
> single entities.

You need to treat table1 and TABLE1 as *separate* or the same?

And I apologize -- at least with the version of sqlite3 that I have
(3.2.1/3.2.2), "table1" and "TABLE1" are in fact treated the same.
They're not *supposed* to be, although table1 and TABLE 1 are supposed
to be. In code:

  SELECT table1 ...
  SELECT TABLE1

These are the same and should be treated the same.

  SELECT "table1"
  SELECT "TABLE1"

These are not the same and shouldn't be treated the same.

-austin
--
Austin Ziegler * [hidden email]
               * Alternate: [hidden email]