On Feb 9, 11:40 am, Roger Oberholtzer <roger.oberholt...@gmail.com> wrote: > On Wed, 2011-02-09 at 08:32 -0500, Chris Nelson wrote: > > Roger Oberholtzer wrote: > > >... > > >> If you open the Trac database (which will depend on various > > >> installation-specific settings), you can do: > > > >> DELETE FROM subtickets WHERE parent=child; > > > > You make it look so simple. I really need to improve my SQL skills. > > > I can never remember the commands. I Googled "sql delete" and got to > >http://www.w3schools.com/sql/sql_delete.asp. While meta commands differ > > a great deal from DBMS to DBMS, the basic SQL (INSERT, UPDATE, DELETE) > > is remarkably stable. > > > > I am guessing I can do this via the sqlite3 command? I am never sure > > > about the BEGIN TRANSACTION / COMMIT stuff. Do I need to put that > > > around the DELETE statement? > > > Transactions come into play when you have multiple commands that have to > > take effect atomically (all of them or none of them). Since this is > > only one command, you shouldn't need that overhead. > > I will try this on a copy. How bad could it get?
Take care only with "WHERE" clause, which should not be missing (If you miss it, all table data is deleted). Otherwise, "go for it". > > > (Despite these questions, I am a C/Tcl/ASM/etc. programmer. Just not > > > so familiar with SQL.) > > > So you're the other Tcl programmer! ;-) > > (http://www.amazon.com/dp/0072120045) > > Seems so. We use it in some interesting places. Overall we like it. But > I confess to glancing at python and pyqt. But still faithful to tcl. > > -- > Roger Oberholtzer -- You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to trac-users@googlegroups.com. To unsubscribe from this group, send email to trac-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/trac-users?hl=en.