Menu

Are MySQL-SET-Columns supported?

Help
Timo Stolz
2007-08-26
2012-09-19
  • Timo Stolz

    Timo Stolz - 2007-08-26

    Hello,

    I've got a table with a SET-Column (which consists of max. 64 Strings, that either can be set or not)
    As I run a SELECT-Statement on this table, an error will occur (see below), if rows are matched, that contain more than one string in the SET-Column.

    Error Message:
    >>> cur.execute('SELECT * FROM events')
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line 159, in execute
    self.errorhandler(self, TypeError, m)
    File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line 35, in defaulterrorhandler
    raise errorclass, errorvalue
    TypeError: str() takes at most 1 argument (2 given)

    As I changed the SET-Columns Value (to only 1 of the 64 possible strings), everything worked again.

    Is there a way to work around this (at best without extra-tables and extra-joins)?

    Greetings from Freiburg, southern Germany,
    Timo

     
    • Timo Stolz

      Timo Stolz - 2007-08-26

      I use:
      MySQL 5
      Python 2.5
      MySQLdb 1.2.1
      (Ubuntu 7.04 on a Fujitsu Simens Lifebook)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.