[Zope-DB] variable names from DCO2 sql-method

Smith, Neil Neil.Smith@npower.com
Mon, 11 Feb 2002 14:14:19 -0000


Dario Lopez-K=E4sten wrote:

> I *think* that this is a consequence of the fact that column names
> in SQL are not case sensitive normally. For example, in Oracle you=20
> explicitly have to name your colums in mixed case for them to be=20
> mixed case:
>
> create table "MonKey" (
>   "wrEnch"         varchar2(2),
>   "l33tSPeaK"      number(2,2),
>   NoMatterWhatCase varchar2(10)
> )
>
> the column NoMatterWhatCase can be accessed as NOMATTERWHATCASE or
> any other combination of small/caps but not the other two columns.=20
> i believe this is true for Postgress as well, but am not sure and,=20
> frankly, I haven't bothered to check ;)

Yes, and no.  That is what happens, but it's not really true to say =
that the
column names are case insensitive.  In the example, the column names =
are
"wrEnch", "133tSPeaK" and "NOMATTERWHATCASE".  If you don't quote a =
column
name then it will be uppercase.  When you write a select statement =
against
the table, then again any column names that you don't quote will be
converted to uppercase, so any mixed case form of NoMatterWhatCase =
without
quotes will find the column, but for the others, if you don't quote the
column names it will look for WRENCH and 133TSPEAK.

I guess that Zope or DCO2, or whatever is doing it, is just trying to =
be
nice and to go some way to making it look like this sort of behaviour.
However I would have thought that it is more trouble than it is worth.  =
For
instance, it makes it possible for someone to get the results of the =
SQL
method, do something to modify one of the variables, then refer to =
another
case form of the variable name and wonder why it hasn't changed. =20

Still I guess even if someone thought it should change, it would break
existing code if it did, so I guess it's pointless.  I just thought I'd =
ask.

> PS: is it possible for you to trim your sig a bit w/o you getting =
killed
by
> Company Policy Police?

No, the rubbish isn't in my signature, it gets added by Outlook Server =
after
I've sent it.  I wish I could get rid of it, but I can't.

Neil
**********************************************************************
 
The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.
    
If you have received this e-mail in error, please notify postmaster@npower.com (UK 01384 275454) and delete it immediately from your system.
    
Neither Npower nor any of the other companies in the Innogy group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.

Npower Limited
Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277

This e-mail may be sent on behalf of a member of the Innogy plc group of companies.

**********************************************************************