Subject | Re: [firebird-support] Re: Followup newbie question about case of identifiers |
---|---|
Author | Ann W. Harrison |
Post date | 2005-02-01T20:03:26Z |
John,
You asked,
discussion and can be interpreted as having internal inconsistencies.
However, what I understand you to ask for is that a table definition
like this:
create table "MiXedCaSe" ....
will create a table that can be accessed from a select statement like this:
select * from MiXedCaSe
and no interpretation of the standard allows that usage.
can use upper and lower case as you wish.
create table a_mixed_Case_Identifier
( one_column integer,
TWO_column varchar(30));
select ONE_COLUMN, TWO_column
from a_MIXED_case_identifier
select One_Column, Two_Column
from a_MiXeD_CaSe_IdEnTiFiEr
What you can't do, without using quotes is have different tables called
myTable and MyTable.
We switch to upper case because it seemed like the most convenient way
to handle the problem when it arose in 1980. We could have made
everything lower case, I suppose, but lower case was a pretty radical
thing then.
system tables if they're translated to upper case before being compared.
Why no do the translation once?
as long as you don't use quoted identifiers. In fact, the culprit here,
it seems to me, is neither the standard nor Firebird, but an overly
ambitious GUI tool that decided that all identifiers should be quoted.
the early 80's). You brace yourself for a huge number of really boring
meetings. You face thousands of pages of e-mails on obscure issues that
no one but the author cares about at all. You learn the art of writing
proposals in the correct format... You abandon all hope...
Cheers,
Ann
You asked,
>>> could we have a mode in a future version that skipped forcingI responded
>>> identifiers parsed from SQL to upper case when they're not quoted?
>>>
>>Probably not... It's a SQL standard thing - identifiers areYour replied
>>case-insensitive and fold to upper case.
> I don't read the standard quite that wayAnd you're right, of course. The standard has a much more complicated
discussion and can be interpreted as having internal inconsistencies.
However, what I understand you to ask for is that a table definition
like this:
create table "MiXedCaSe" ....
will create a table that can be accessed from a select statement like this:
select * from MiXedCaSe
and no interpretation of the standard allows that usage.
> So, this should be perfectly valid:I think so. And, of course, if you don't use quotes at all you
>
> create table a_mixed_Case_Identifier
> ( one_column integer,
> , "TWO_column" varchar(30)
> )
> ...
> select ONE_COLUMN, "TWO_column"
> from a_MIXED_case_identifier
>
> And the way FB behaves would seem to be consistent with this.
can use upper and lower case as you wish.
create table a_mixed_Case_Identifier
( one_column integer,
TWO_column varchar(30));
select ONE_COLUMN, TWO_column
from a_MIXED_case_identifier
select One_Column, Two_Column
from a_MiXeD_CaSe_IdEnTiFiEr
What you can't do, without using quotes is have different tables called
myTable and MyTable.
>Firebird's system tables have little or nothing to do with the standard.
> So, I concede that it is possible to read the standard as requiring
> the switch to upper-case for storage in the system tables
We switch to upper case because it seemed like the most convenient way
to handle the problem when it arose in 1980. We could have made
everything lower case, I suppose, but lower case was a pretty radical
thing then.
> Personally, I agree with treating them asI guess I don't see why it matters how the strings are stored in the
> equivalent and with the part about storing the variant that is first
> encountered.
system tables if they're translated to upper case before being compared.
Why no do the translation once?
> Forcing everything to upper-case is giving up way tooYour programs, procedures, triggers, etc. can used upper and lower case,
> much in readability.
as long as you don't use quoted identifiers. In fact, the culprit here,
it seems to me, is neither the standard nor Firebird, but an overly
ambitious GUI tool that decided that all identifiers should be quoted.
> So, how do I get myself onto the standardsYou or your company joins the standards organization (was $20K or so in
> committee next time around? ;-\
the early 80's). You brace yourself for a huge number of really boring
meetings. You face thousands of pages of e-mails on obscure issues that
no one but the author cares about at all. You learn the art of writing
proposals in the correct format... You abandon all hope...
Cheers,
Ann