Re: [CDBI] Reserved words in MySQL

Rhesa Rozendaal <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Carlos Vicente wrote:
> Hi all,
> 
> After upgrading to MySQL5 I started getting errors caused by some of my
> tables having names that are now reserved words (e.g. "Connection")


> In looking for possible solutions, I noticed the table_alias method, but
> I'm not convinced that that's of any use here.  I'm trying to not have
> to rename the table.  

You could just do

   __PACKAGE__->table('`Connection`');

or prefix it with the database name:

   __PACKAGE__->table('your_db_name.Connection');

> I fixed the db creation scripts by wrapping the table names in backticks
> (``), but I can't control how Class::DBI builds its SQL.  It'd be great
> if this could be turned on somewhere globally.

HTH,

Rhesa
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.