2009/9/13 Alex <xkty...@gmail.com>
> How to use illegal names for MySQL with SQLObject?
> In pure SQL it is possible to use backuotes, say:
> SELECT `select from` FROM table1 WHERE 1;
> ...can be used to select the field called `select from`.
> My situation is that I already have a DB which I'm trying to connect
> with SQLObject to. MySQL throws an error because the table has illegal
> names.
> Is it possible to tell SQLObject to utilize backquotes?
>
Hi,
maybe you can just try to experiment with:
>>> class User(SQLObject):
...
... class sqlmeta:
... # user is a reserved word in some databases, so we won't
... # use that for the table name:
... table = "user_table"
...
(taken from http://www.sqlobject.org/SQLObject.html )
and with dbName
class Cenktgm01(SQLObject):
class sqlmeta:
idType = str
idName = 'OID$CENKTGM01'
nazev = UnicodeCol(dbName="nazev", dbEncoding = "1250")
skupina = StringCol(length = 30)
You can also switch:
_connection.debug = True
You will see the SQL output. I have found it very useful.
HTH
Petr
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss