Difference between revisions of "ONINSERT Table Constraint"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 1: Line 1:
=ONINSERT=
 
 
 
==Class==
 
Table Constraints
 
 
 
 
==Purpose==
 
==Purpose==
 
Table constraint activated when an attempt is made to insert a new record into the table
 
Table constraint activated when an attempt is made to insert a new record into the table

Revision as of 15:18, 29 October 2009

Purpose

Table constraint activated when an attempt is made to insert a new record into the table


Syntax

ONINSERT <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 ONINSERT table constraint is activated when an attempt is made to insert a new record into the table. 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 before the operation to insert the record is executed and must return True (.T.) or the insert operation is cancelled.


Example

ALTER TABLE customer modify ONINSERT "p_insert";


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer