[Gambas-user] RE: Database Field Names

ron ronstk at ...239...
Wed Apr 19 16:08:12 CEST 2006


On Wednesday 19 April 2006 12:59, Patrick JACQUOT wrote:
> GuruLounge - MailLists wrote:
> 
> >If you're stuck with lowercase in field names you could always get a
> >little bit creative and try to store the field names in an optional
> >field the keeps the case.  Maybe even create a separate table just for
> >field names and create unique field names based on that.
> >
> >Might be a b*tch for search and the like but it could be a work-around.
> >
> >HTH,
> >Jeff
> >
> >On Wed, 2006-04-19 at 08:55 +0100, Timothy Marshal-Nichols wrote:
> >  
> >
> >>Thanks. I was a bit annoyed when I sent that email. I have charmed down now.
> >>
> >>First thoughts. How about:
> >>
> >>1.	Send the field name to the database in the case entered by the user.
> >>2.	Before the field name is sent to the database check the name is unique in
> >>the table with a case insensitive test. Do not allow field names that fail
> >>the case insensitive test.
> >>
> >>Thanks
> >>
> >>8-{)} Timothy Marshal-Nichols
> >><mailto: timothy.marshal-nichols at ...247...>
> >>
> >>
> >>    
> >>
> >
> >  
> >
> AFAIK the case-insensitiveness of field names (and table names) is 
> required by the SQL standard.
> Some SGBD allow case sensitiveness by various means
> e.g. in PostgreSQL when the name is enclosed in double quotes
> 
> --
> Patrick
> 

For MySQL it is case sensitive for database and table names
and not for fieldnames in phpmyadmin on linux and also gambas to

http://dev.mysql.com/doc/refman/4.1/en/name-case-sensitivity.html

9.2.2. Identifier Case Sensitivity
----------------------------------
In MySQL, databases correspond to directories within the data directory. 
Each table within a database corresponds to at least one file within the 
database directory (and possibly more, depending on the storage engine). 
Consequently, the case sensitivity of the underlying operating system 
determines the case sensitivity of database and table names. 

This means database and table names are not case sensitive in Windows, and case 
sensitive in most varieties of Unix. One notable exception is Mac OS X, which is 
Unix-based but uses a default filesystem type (HFS+) that is not case sensitive. 
However, Mac OS X also supports UFS volumes, which are case sensitive just as on 
any Unix. See Section 1.9.4, “MySQL Extensions to Standard SQL”. 
The lower_case_table_names system variable also affects how the server handles 
identifier case sensitivity, as described later in this section. 

Note: Although database and table names are not case sensitive on some platforms, 
you should not refer to a given database or table using different cases within the 
same statement. The following statement would not work because it refers to a 
table both as my_table and as MY_TABLE: 





More information about the User mailing list