Difference between revisions of "CREATE TRIGGER"
From Lianjapedia
Yvonne.milne (Talk | contribs) (→Description) |
|||
Line 51: | Line 51: | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:Triggers]] | [[Category:Triggers]] | ||
+ | [[Category:Lianja VFP Extensions]] | ||
+ | [[Category:VFP Command Extensions]] |
Revision as of 06:39, 10 December 2012
Contents
Purpose
Creates a trigger for a table
Syntax
CREATE TRIGGER ON [<database>!]<table>
FOR UPDATE | INSERT | DELETE
AS <expression>
See Also
ADD TABLE, ALTER INDEX, ALTER TABLE, CONSTRAINTS, DATA TYPES, DELETE TRIGGER, DROP TABLE, GETENV(), INSERT, SELECT, SET AUTOCATALOG, SET XMLFORMAT,
Description
The CREATE TRIGGER command is used to create a trigger for the specified table. Triggers cause the logical <expression> to be evaluated when certain operations are attempted.
Trigger | Operation |
---|---|
UPDATE | Attempt to modify an existing record |
INSERT | Attempt to add a new record |
DELETE | Attempt to delete an existing record |
If the <expression> evaluates to False (.F.) the operation does not complete. If the <expression> evaluates to True (.T.) the operations does complete.
Keywords | Description |
---|---|
database | The name of the database to which the table belongs. |
table | The name of the table |
INSERT | DELETE | Specifies the type of trigger to be created. |
expression | A logical expression to be evaluated |
Example
USE accounts CREATE TRIGGER ON customer FOR UPDATE AS not empty(CustName)