|WikiProject Databases / Computer science|
Addition of Row/Statement Level Triggers
Row and statement level triggers are an important component of how triggers behave. I saw the article lacking explanation on this topic so I have adding examples of each combination(Before/Each Row, Before/Statement,After/Each Row, After/Statement). If you want to add addition examples in this topic and wish to stick with the same style I used, using a phone_book, send me a message and I can send you the .sql file. I have also noticed that the Database topic as a whole lacks a lot of components of the SQL language. When trying to put this wiki section together I noticed there is no coverage on SQL built in functions. I have cited an outside source showing a listing and describing some functions in SQL, nothing added to Wikipedia though. SQL functions would be a helpful and easy to put together resource. Hauschbc (talk)hauschbc
Are triggers described by SQL93? What systems are compliant? Are these various features of various servers compliant or vendor extensions?
Imagine if a trigger was a method on an object.. When an object is modified, the trigger method is executed which then calls other objects and maintains invariants in the datastructure (garbage collection). Thus a trigger is nothing more than a precondition of a transaction to a database table (or an object).. However you like to look at it..
mutating table errors
We should add an explanation and an example for this problem. Additionally, it may be good to have some information on the behavior of different systems, i.e. can such errors occur or are they prevented. --Stolze 18:15, 19 November 2006 (UTC)
Microsoft SQL Server 'Inserted' and 'Deleted' Tables
After searching the internet for hours trying to figure out how to access data from the affected rows for conditional-trigger-logic, I stumbled upon MSDN's documentation of Inserted and Deleted tables, which store these values for the trigger incase it needs them. I added a small reference to these tables, but the comments I left could be worked over a little better.
I felt they were relevant here since it is mentioned that Triggers don't have parameters or arguments - thus the user should use the Inserted and Deleted tables for conditional-logic. —Preceding unsigned comment added by Sampsonvideos (talk • contribs) 19:24, 26 September 2007 (UTC)
No rollback of transactions via trigger?
According to the SQL documentation at least their server has the abilitiy to rollback transactions URL: http://msdn.microsoft.com/msdnmag/issues/03/12/DataPoints/ Can someone please check/clarify this? —Preceding unsigned comment added by 22.214.171.124 (talk) 15:08, 11 January 2008 (UTC)
Triggers in PostgreSQL
This section is a bit vague/confusing. You're left with the question so what triggers does PostgreSQL support? Lunchsure (talk) 20:27, 28 April 2008 (UTC) THATS —Preceding unsigned comment added by 126.96.36.199 (talk) 11:21, 1 November 2008 (UTC)
Postgresql does not support database level constraints
Removed the part where it says: "PostgreSQL's database-level constraints may perform a similar function to a TRANSACTION COMMIT trigger, though they are oriented toward detecting and preventing disallowed conditions, not performing arbitrary operations."
Because PostgreSQL does not have database-level constraints (CREATE ASSERTION) (if it does, please add a reference that backups that claim). —Preceding unsigned comment added by 188.8.131.52 (talk) 14:58, 31 March 2010 (UTC)
- My mistake. I think I was remembering the ability to defer constraints (which may be limited to foreign key constraints at the moment?) and the ability to create deferred constraint triggers. You could probably hack something up, where all tables have triggers that cause one central table's deferred constraint trigger to fire, effectively giving you on-commit triggers, but that'd be a mess, and speculative, and therefore not worthy of the main article. Thanks for catching it.Unordained (talk) 19:20, 14 April 2010 (UTC)
The article draws an implicit distinction between DDL triggers and DML triggers but then doesn't define DML (doesn't even cross-link to the Wikipedia article on DML). I've added this cross-link and made the distinction explicit.