Subject | Reserved keywords in column names vs. case |
---|---|
Author | PenWin |
Post date | 2007-08-20T06:35:58Z |
Hi again!
I am rewriting a certain application, which currently only works with MySQL
(quite poorly at that, but that's not an issue here), to support Firebird.
The idea is that I will rewrite some key parts of the application in such a
way as to work with either database (or any other, if someone feels like
writing the relevant SQL code). To keep backwards compatibility, I want to
use as much of the old data structures as possible (even though the original
database design is simply awful). Unfortunatelly, that means many fields
have names which are reserved in Firebird (e.g. 'view'). I can overcome this
obstacle by enclosing them in quotes (SELECT "view" FROM table WHERE ...),
but if I do this, Firebird expects me to match the case of the field name
exactly (SELECT "View" ... [notice the capital V] won't work) - unlike
regular field names, which are always converted to upper case first. The
question is: Is there some way to allow field names like "view" but keep
them case-insensitive? I suspect there's not, but I'd like to be sure before
I commit myself...
Thanks,
Pepak
I am rewriting a certain application, which currently only works with MySQL
(quite poorly at that, but that's not an issue here), to support Firebird.
The idea is that I will rewrite some key parts of the application in such a
way as to work with either database (or any other, if someone feels like
writing the relevant SQL code). To keep backwards compatibility, I want to
use as much of the old data structures as possible (even though the original
database design is simply awful). Unfortunatelly, that means many fields
have names which are reserved in Firebird (e.g. 'view'). I can overcome this
obstacle by enclosing them in quotes (SELECT "view" FROM table WHERE ...),
but if I do this, Firebird expects me to match the case of the field name
exactly (SELECT "View" ... [notice the capital V] won't work) - unlike
regular field names, which are always converted to upper case first. The
question is: Is there some way to allow field names like "view" but keep
them case-insensitive? I suspect there's not, but I'd like to be sure before
I commit myself...
Thanks,
Pepak