Glom - Remove all records in database

View: New views
2 Messages — Rating Filter:   Alert me  

Glom - Remove all records in database

by Patrick Chan-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Cheers,
Patrick
_______________________________________________
glom-devel-list mailing list
glom-devel-list@...
http://mail.gnome.org/mailman/listinfo/glom-devel-list

Re: Glom - Remove all records in database

by Murray Cumming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
www.murrayc.com
www.openismus.com

_______________________________________________
glom-devel-list mailing list
glom-devel-list@...
http://mail.gnome.org/mailman/listinfo/glom-devel-list