On 19 Sep 2009, at 9:14pm, Darren Duncan wrote:

> Simon Slavin wrote:
>> On 18 Sep 2009, at 9:43pm, Noah Hart wrote:
>>> Stored Procedures
>>
>> How do those differ from what can be done with triggers ?
>
> A stored procedure is an arbitrary-sized named sequence of  
> statements to
> execute, which is stored in the database as data (same as table or  
> view or
> trigger definitions), and which generally is explicitly invoked as a  
> statement.
>
> A trigger is a stimulus-response rule that says when a particular  
> event happens
> then a particular stored procedure is to be executed automatically.   
> In the
> general case, this is like an event handler in a typical application  
> that
> responds to mouse clicks or network connections or whatever.  Some  
> DBMSs support
> this in the more general sense of "do this when this happens" but  
> most DBMSs
> that support "triggers" just handler more limited situations, such  
> as "do this
> before/after a record is inserted/updated/deleted in this table".

Ah.  Okay, so in SQLite3 you can emulate stored procedures using  
triggers.  Just define a trigger to operate on something that doesn't  
matter to you.  For instance inserting a record in a table that you  
never bother reading.  Every so often you delete all rows in the table  
just to keep it from taking up pointless space.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to