MySQL reserved words, redux

[prev] [thread] [next] [Date index for 2004/10/12]

From: Jesse Sheidlower
Subject: MySQL reserved words, redux
Date: 02:27 on 12 Oct 2004
I see there have been a few discussions about how CDBI deals,
or rather doesn't, with reserved words in MySQL used as column
names. Most recently someone was trying to do this in a
Maypole context (and the thread then went in another
direction), but the question has come up before.

Is there any way to just wrap all column names in backticks,
universally? For CDBI::mysql only. This would seem to have no
drawbacks, and would prevent any problem like this from
occurring. I see that Class::DBI::Oracle has a system for
dealing with reserved words, but only as table names, using
the table_alias method.

Or might there be some other solution?

Obviously I'm in a situation where I want to used a reserved
word as a column name. Unlike the sitation reported by some
other posters, my choice isn't based on the fact that I think
the word is particularly felicitous; it's that I have a
complex collection of SGML files, with some tag names
coincidentally being reserved words in MySQL, and there is a
database mapping this SGML, and a number of different
applications using the database, and I can't change the
underlying SGML and don't want to rewrite all the databases to
make them no longer directly map the SGML.

Jesse Sheidlower

MySQL reserved words, redux
Jesse Sheidlower 02:27 on 12 Oct 2004

Re: MySQL reserved words, redux
Tony Bowden 09:51 on 12 Oct 2004

Re: MySQL reserved words, redux
Jesse Sheidlower 12:54 on 12 Oct 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52