Difference between revisions of "ONAFTERINSERT Table Constraint"

From Lianjapedia
Jump to: navigation, search
(Created page with '==Purpose== Table constraint activated after a record in the table is inserted ==Syntax== ONAFTERINSERT <procedure> ==See Also== ALTER TABLE, [[SQL Constraints|CONSTRAINTS]…')
 
(Example)
 
Line 16: Line 16:
 
<code lang="recital">
 
<code lang="recital">
 
ALTER TABLE customer;
 
ALTER TABLE customer;
   modify ONFTERINSERT "customer_afterinsert"
+
   modify ONAFTERINSERT "customer_afterinsert"
 
</code>
 
</code>
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]

Latest revision as of 04:47, 30 November 2018

Purpose

Table constraint activated after a record in the table is inserted

Syntax

ONAFTERINSERT <procedure>

See Also

ALTER TABLE, CONSTRAINTS, CREATE TABLE

Description

A constraint is used to define rules that help to provide data integrity. TABLE constraints apply to table-based operations. You must have ALTER privilege on the table. The table will be locked for EXCLUSIVE use during the operation.

The ONAFTERINSERT table constraint is activated after a record in the table is updated. The <procedure> specified must be a character expression evaluating to a procedure name. If no file extension is included, '.prg' is assumed. The specified procedure is run after the operation to insert a record is executed.

Example

ALTER TABLE customer;
  modify ONAFTERINSERT "customer_afterinsert"