Re: Glom - Remove all records in database



On Sat, 2009-07-04 at 20:32 +1000, Patrick Chan wrote:
Hi all,

Not sure if this has been covered before, but I can't seem to figure
out how to remove all the existing records in a particular table.

I've got 1600+ records in a table and because I'm still on the testing
phase, I want to be able to rapidly remove them and re-import them
from a CSV file back to Glom.

I'm sure I can somehow execute an SQL statement (maybe using a
button?) but I'm not quite sure how to approach it.

Any pointers/hints would be appreciated. Thanks.

Sorry for the delay.

Yes, you can run a script from a button. And you can use the pygda API,
together with the record.connection (a GdaConnection object) to execute
arbitrary SQL. For instance:
http://git.gnome.org/cgit/glom/tree/examples/example_scripts/repository_analyzer_begin_scan.py#n1249 

However, that script is fairly old. The pygda API might be slightly
different now.

That script is from:
http://www.murrayc.com/blog/permalink/2006/10/25/repository-analyzer-improvements/


And this is even covered in Glom's manual:
http://library.gnome.org/users/glom/unstable/sec-calculated-fields.html.en#using-the-full-pygda-api

-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]