Hi,
Is there is any update on the usage of reserved keywords in the table definition. In this thread
I need to create a table in mysql db as:
db.define_table('rms_rule',
Field('condition', requires=IS_IN_SET(['IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In'])),
)
I tried with backticks(`) as mysql stats and different combinations of qoutes.
If I use it as given above the error is a mysql programming error:
ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition VARCHAR(255),\n description VARCHAR(255) NOT NULL,\n params VARCHA' at line 13")
So it passed DAL but escaping might be the problem. But using the backticks as mysql says, it generates syntax error which is caught by DAL.
db.define_table('rms_rule',
Field('`condition`', requires=IS_IN_SET(['IsEqual','IsNotEqual','IsGreater','IsLesser','IsNull','IsNotNull','Likeliness','IsMatch','IsNotMatch','In'])),
)
SyntaxError: invalid table or field name: `condition`
is there any way in escaping these reserve keywords. Its difficult to change the field name as its already defined by third party in mysql.
The above thread was one year back.