Re: [Zope] SQLTEST is case insensitive?
FThe Doctor What writes:
The problem is two fold: 1) ID = 1 should be "ID" = 1 so that PostgreSQL will treat it as a case sensitive string. This was discussed some time ago (--> list archives). Changing "dtml-sqltest" to enclose the column name in double quotes would break lots of code (as many people rely on the case insensitive interpretation).
2) ID = 1 should really be "URL"."ID", but I can't figure out how to pass that through sqltest! You know the "column" argument to "dtml-sqltest". It can be used to provide an alternativ column name. The quotes will make difficulties, however, as they would be interpreted as DTML syntax.
You can use vanilla DTML to emulate "dtml-sqltest" like for example: .... "URL"."ID" = '<dtml-var ID sql_quote>' .... Dieter
* Dieter Maurer (dieter@handshake.de) [010307 16:39]:
FThe Doctor What writes:
The problem is two fold: 1) ID = 1 should be "ID" = 1 so that PostgreSQL will treat it as a case sensitive string. This was discussed some time ago (--> list archives). Changing "dtml-sqltest" to enclose the column name in double quotes would break lots of code (as many people rely on the case insensitive interpretation).
But consider. A feature is *missing* currently (the ability to use sqltest and other dtml-sql* vars) with case sensitive databases. Would adding a toggle that says "Use double quotes" be a bad thing? Frankly, I can't imagine anyone relying on having all their queries dropped to lowercase. Why would someone, who avoided using cases suddenly switch to throwing upper case characters into their sql queries?
2) ID = 1 should really be "URL"."ID", but I can't figure out how to pass that through sqltest! You know the "column" argument to "dtml-sqltest". It can be used to provide an alternativ column name. The quotes will make difficulties, however, as they would be interpreted as DTML syntax.
Obviously, if DTML had a method for adding quotes as arguments, this wouldn't be a problem in the first place.
You can use vanilla DTML to emulate "dtml-sqltest" like for example:
.... "URL"."ID" = '<dtml-var ID sql_quote>' ....
Thereby removing the whole benifit of using ZOPE and ZSQL objects. Thanks for, at least, telling me that the problem is in ZSQL and Zope, not the DA. Ciao! -- "There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy." -- Wm. Shakespeare, (Hamlet) The Doctor What: Need I say more? http://docwhat.gerf.org/ docwhat@gerf.org KF6VNC
participants (2)
-
Dieter Maurer -
The Doctor What