By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

Deleting rows using PyDO from SkunkWeb

P: n/a
Hello group.
Could someone descripe how to delete many row at one time
from MySQL database using SkunkWeb PyDO pacgage ??
Documentation is very short about that ...
Assume that Base is class define like in PyDO doc, so
Base.new(...) adds new row..
Documetation show ony delete() without any arguments.
SQL query is like "DELETE FROM SESSIONS WHERE acc_time < '398984353'"

Thanks for read this :-)

--
Marcin Jurczuk, NIC-HDL: MJ1679-RIPE
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Marcin Jurczuk <mj*******@tkb.pl> wrote in message news:<cg*********@korweta.task.gda.pl>...
Hello group.
Could someone descripe how to delete many row at one time
from MySQL database using SkunkWeb PyDO pacgage ??
Documentation is very short about that ...
Assume that Base is class define like in PyDO doc, so
Base.new(...) adds new row..
Documetation show ony delete() without any arguments.
SQL query is like "DELETE FROM SESSIONS WHERE acc_time < '398984353'"


I just came across this by accident; PyDO questions are better asked
on the skunkweb mailing list.

But to answer it quickly -- the delete() method deletes a particular
instance (one row). If you want delete a range of rows with a single
SQL statement, the best way is simply to use SQL, accessing the
underlying db connection:

c=Sessions.getDBI().conn.cursor()
c.execute("DELETE FROM SESSIONS WHERE acc_time < '333333'")
# this is equivalent to Sessions.getDBI().conn.commit()
Sessions.commit()

Hope that helps,

Jacob Smullyan
Jul 18 '05 #2

P: n/a
On 2004-09-07, Jacob Smullyan <sm******@gmail.com> wrote:
Marcin Jurczuk <mj*******@tkb.pl> wrote in message news:<cg*********@korweta.task.gda.pl>...

But to answer it quickly -- the delete() method deletes a particular
instance (one row). If you want delete a range of rows with a single
SQL statement, the best way is simply to use SQL, accessing the
underlying db connection:

c=Sessions.getDBI().conn.cursor()
c.execute("DELETE FROM SESSIONS WHERE acc_time < '333333'")
# this is equivalent to Sessions.getDBI().conn.commit()
Sessions.commit()

Hope that helps,

Jacob Smullyan

Thx - I've wrote my own class to access SQL because it was faster than
searching answer for PyDO.
Next time will help :)
--
Marcin Jurczuk, NIC-HDL: MJ1679-RIPE
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.