Legacy table with reserved keyword in column name

87 views
Skip to first unread message

Fabiano Almeida

unread,
Oct 26, 2017, 3:56:45 PM10/26/17
to web...@googlegroups.com
Hi!

How to put in the DAL a legacy table whose column name matches reserved SQL words?

Traceback:
SyntaxError: invalid table/column name "Message" is a "ALL" reserved SQL/NOSQL keywor


thanks

Val K

unread,
Oct 26, 2017, 4:22:49 PM10/26/17
to web...@googlegroups.com
Hi
I think check_reserved=['common'] (or just check_reserved='common') will solve the problem

Nico de Groot

unread,
Oct 27, 2017, 4:14:48 AM10/27/17
to web2py-users
No, that just changes how the DAL checks for conflicts with reserved SQL words. It depends on the backend which words are problematic. See the book. If you really want to use a reserved word check out the rname parameter of Field.

Nico de Groot

Fabiano Almeida

unread,
Oct 27, 2017, 11:57:47 AM10/27/17
to web...@googlegroups.com
Wow, thanks!

The rname parameter of Field solved the problem.

2017-10-27 6:14 GMT-02:00 Nico de Groot <ndeg...@gmail.com>:
No, that just changes how the DAL checks for conflicts with reserved SQL words. It depends on the backend which words are problematic. See the book. If you really want to use a reserved word check out the rname parameter of Field.

Nico de Groot

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pbreit

unread,
Oct 30, 2017, 3:01:30 AM10/30/17
to web2py-users
Book says check_reserved defaults to None but "welcome" app specifies "all":

Can I safely switch that to None or ['']?

Doesn't/Couldn't the DAL escape everything so this would not ever be an issue?




Reply all
Reply to author
Forward
0 new messages