Deleting rows using PyDO from SkunkWeb

Marcin Jurczuk mj-usunto at tkb.pl
Tue Sep 7 17:37:09 EDT 2004


On 2004-09-07, Jacob Smullyan <smulloni at gmail.com> wrote:
> Marcin Jurczuk <mj-usunto at tkb.pl> wrote in message news:<cg2719$c8$1 at 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



More information about the Python-list mailing list