[Zope] dtml-sql case sens. issue

Geir Bækholt Geir Bækholt
Fri, 16 May 2003 13:44:07 +0200


On  Fri, 16 May 2003 14:21:17 +0300 GMT (..13:21 where i live(GMT+2) )
Michael Dexter asked the Zope mailinglist about the following:
  

MD> Hello,

MD> I am experimenting with SQL under Zope and have started with the 
MD> "Elvis Sighting" tutorial. I've created my own table with obvious 
MD> names like "varcharField0" for the first field, which is a varchar. I 
MD> used an uppercase "F" to make it a little easier to read. I 
MD> understand that SQL is generally not case sensitive. Here's the SQL 
MD> to create the table, the "stored procedure" to view all and the DTML 
MD> snippet that calls it.

MD> The issue: <dtml-var varcharField0> BREAKS while "varcharfield0" works.

MD> Whose case sensitivity problem is this? Zopes? SQL's? The Browser?

While SQL is case-insensitive, Python (and thus Zope) is not. The
result-object instances you get from calling ZSQLmethods have to have
names for their fields, and as SQL (and the data returned from the
database) is case-insensitive there is no way for the ZSQLmethod to
know that you called your column "varcharField0" and not
"varcharfield0".

IIRC the variables returned in a result-object are accessible both as
uppercase and lowercase names (correct me if i am wrong), but not
mixed-case..

--
Geir Bækholt