You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SQLElixir
Hi,
I'm trying to create triggers on a sqlite database.
I can create triggers using a database management tool like
SQLiteStudio. What I
want to do is implement the triggers in my python code.
I've tried using the "perform_ddl" method. I can do simple inserts of
data using the perform_ddl mehtod, but when sqlalchemy creates the
tables it doesn't seem to create my trigger. Here is whats my
statement looks like:
perform_ddl = ('after-create',
"CREATE TRIGGER
tgr_vendor_rma_item_UpdatePartStatusFailed AFTER INSERT ON
vendor_rma_item FOR EACH ROW BEGIN UPDATE Part SET status = 3 WHERE id
= ( SELECT part_id FROM vendor_rma_item WHERE part_id = NEW.part_id );
END;")
Am I missing something here? Is there possibly a better way to create
triggers than using the entity's perform_ddl method? Perhaps I need
to do this with sqlalchemy methods?
alex bodnaru
unread,
May 11, 2011, 2:03:44 AM5/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqle...@googlegroups.com
cool you're using my extension ;) .
remove the first '=' please.
JayFoolie
unread,
May 11, 2011, 7:19:50 PM5/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SQLElixir
Haha thanks that worked! I must of had tunnel vision when reading the
api docs.
Thank you for creating this extension, its proving to be very useful.