-
The important thing to remember is that the escaping mechanism built into execute() is for column values. You'd use it for "INSERT INTO t (a, b) VALUES (%s, %s)" or "SELECT * FROM t WHERE col1=%s".
What you were doing is not value substitution, but dynamic SQL (creating a dynamic query with a changeable table name). That's the place for doing string-style (%...
2009-09-25 06:59:37 UTC in MySQL for Python
-
The default cursor can be used as an iterator:
for row in cursor:
print "Hey,", row[1], row[2]
Or you can just call fetchone() repeatedly (in a loop) to fetch a row at a time. It'll return None when the results are exhausted
while True:
row = cursor.fetchone()
if row is None:
break
print "Hey,", row[1], row[2].
2009-09-23 05:36:39 UTC in MySQL for Python
-
The intention is that you should only need to import MySQLdb. The \_mysql\_exceptions library is named with the leading underscore to hint that it is used internally only.
If you have a specific problem that happens when using MySQLdb.SomeException _only_, feel free to write a bug report. I'm puzzled by your claim that the isinstance() result changes over time. That is curious.
2009-09-15 18:23:46 UTC in MySQL for Python
-
Sounds like you have an include path problem in PyDev. Run "print sys.path" from both environments and look for differences.
2009-09-08 19:37:57 UTC in MySQL for Python
-
This is now fixed in trunk by change 633. It doesn't affect 1.2br.
2009-07-24 00:36:59 UTC in MySQL for Python
-
kylev committed revision 633 to the MySQL for Python SVN repository, changing 1 files.
2009-07-24 00:35:20 UTC in MySQL for Python
-
This is now fixed in 1.2br and trunk. Will be in next releases.
2009-07-24 00:28:38 UTC in MySQL for Python
-
kylev committed revision 632 to the MySQL for Python SVN repository, changing 1 files.
2009-07-24 00:27:38 UTC in MySQL for Python
-
kylev committed revision 631 to the MySQL for Python SVN repository, changing 1 files.
2009-07-24 00:23:14 UTC in MySQL for Python
-
kylev committed revision 630 to the MySQL for Python SVN repository, changing 1 files.
2009-07-24 00:18:07 UTC in MySQL for Python