views:

25

answers:

1

Hi. I've just found the following in the Doctrine manual:

Just because you CAN use delimited identifiers, it doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve. Anyway, it may be necessary when you have a reserved word as a field name (in this case, we suggest you to change it, if you can).

Which problems may delimiting cause?

A: 

`` delimiters are not portable.
"" delimiters are more portable, but to get them working in mysql you have to enable ANSI mode.

Naktibalda
what is `not portable`?
roddik
He means: MySQL is the only DBMS that uses backticks ` as identifier quotes. The ANSI SQL standard specifies double-quotes " as identifiser characters. (MySQL will treat double-quotes as enclosing a string unless you specify otherwise.) Other DBMSs also have proprietary identifier characters; for example SQL Server uses square brackets [...] (although it will also accept double-quotes)
Hammerite
@Hammerite - but what does it have to do with Doctrine? I didn't specify this kind of quotes and I guess if I switch dbs they'll go away automatically. So basically you mean that as long as I don't store SQL, generated by Doctrine (who would do that?), the statement I quoted is incorrect?
roddik
No experience with Doctrine; can't comment.
Hammerite