There's nothing in the actual code that uses escaping. we tried but it was reverted soon.
It's on the roadmap but it's not done yet, as it is a rather hard point. On the implementation process, we may provide a "sql_name" attribute for both fields and tables that will output the escaped sequence for the "object" needed. Using row.backtick_fieldname_backtick is kinda a bummer.... separing "field names" from "sql names" allows to "map" your preferred name to your actual column/table in the database. Il giorno martedì 18 giugno 2013 09:09:16 UTC+2, ajith c t ha scritto: > > Hi, > Is there is any update on the usage of reserved keywords in the table > definition. In this thread > > > https://groups.google.com/forum/?fromgroups=#!newtopic/web2py/web2py/hCsxVaDLfT4 > Massimo > says "we need to change it in dal.py." > > 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. > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.