ibm-information-center/dist/eclipse/plugins/i5OS.ic.dbp_5.4.0.1/rbaforzahftra.htm

92 lines
7.1 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Trigger automatic events in your database" />
<meta name="abstract" content="A trigger is a set of actions that run automatically when a specified change or read operation is performed on a specified database file. On iSeries, you define a set of trigger actions in any supported high-level language." />
<meta name="description" content="A trigger is a set of actions that run automatically when a specified change or read operation is performed on a specified database file. On iSeries, you define a set of trigger actions in any supported high-level language." />
<meta name="DC.subject" content="trigger, defined, benefits, using" />
<meta name="keywords" content="trigger, defined, benefits, using" />
<meta name="DC.Relation" scheme="URI" content="rbafomanage.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafotrguse.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafotrgben.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftrb.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftrn.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftro.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftrp.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftrv.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftrq.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftrr.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforitgint.htm" />
<meta name="DC.Relation" scheme="URI" content="../sqlp/rbafysqltrig.htm" />
<meta name="DC.Relation" scheme="URI" content="../sqlp/rbafykickoff.htm" />
<meta name="DC.Relation" scheme="URI" content="http://www.redbooks.ibm.com/abstracts/sg246503.html" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbaforzahftra" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Trigger automatic events in your database</title>
</head>
<body id="rbaforzahftra"><a name="rbaforzahftra"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Trigger automatic events in your database</h1>
<div><p><span><img src="./delta.gif" alt="Start of change" />A <em>trigger</em> is a set of actions that run
automatically when a specified change or read operation is performed on a
specified database file. On <span class="keyword">iSeries™</span>,
you define a set of trigger actions in any supported high-level language.<img src="./deltaend.gif" alt="End of change" /></span></p>
<p>The change operation can be an insert, update, or delete high-level language
statement in an application program. The read operation can be a fetch, get,
or read high-level language statement in an application program.</p>
<p>You can also use SQL triggers.</p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbafotrguse.htm">Uses for triggers</a></strong><br />
Triggers in the database have several uses.</li>
<li class="ulchildlink"><strong><a href="rbafotrgben.htm">Benefits of using triggers in your business</a></strong><br />
Triggers offer benefits to your business.</li>
<li class="ulchildlink"><strong><a href="rbaforzahftrb.htm">Create trigger programs</a></strong><br />
These topics discuss how to create and work with trigger programs.</li>
<li class="ulchildlink"><strong><a href="rbaforzahftrn.htm">Add triggers</a></strong><br />
This topic shows how to add triggers to a database file.</li>
<li class="ulchildlink"><strong><a href="rbaforzahftro.htm">Display triggers</a></strong><br />
The Display File Description (DSPFD) command provides a list of the triggers that are associated with a file. Specify TYPE(*TRG) or TYPE(*ALL) to get this list.</li>
<li class="ulchildlink"><strong><a href="rbaforzahftrp.htm">Remove triggers</a></strong><br />
<span><img src="./delta.gif" alt="Start of change" />You can remove triggers using the Remove Physical
File Trigger (RMVPFTRG) command, the SQL DROP TRIGGER statement, and iSeries Navigator.<img src="./deltaend.gif" alt="End of change" /></span></li>
<li class="ulchildlink"><strong><a href="rbaforzahftrv.htm">Enable or disable physical file triggers</a></strong><br />
You can enable or disable triggers using the Change Physical File
Trigger (CHGPFTRG) command and iSeries Navigator.</li>
<li class="ulchildlink"><strong><a href="rbaforzahftrq.htm">Triggers and their relationship to CL commands</a></strong><br />
Triggers interact with CL commands in several ways.</li>
<li class="ulchildlink"><strong><a href="rbaforzahftrr.htm">Triggers and their relationship to referential integrity</a></strong><br />
A physical file can have both triggers and referential constraints associated with it. The running order among trigger actions and referential constraints depends on the constraints and triggers that are associated with the file.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafomanage.htm" title="These topics discuss how to maintain control of database files on your system by managing the files, their descriptions and attributes. Information about how to maintain control over your data to protect it from loss, how to ensure data integrity with constraints, and how to set up trigger events when the data changes is included.">Manage database files</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbaforitgint.htm" title="The system provides features to improve the integrity and consistency of your data. Two ways to protect data are enforcing business rules and enforcing data type rules.">Database data protection and monitoring</a></div>
<div><a href="../sqlp/rbafysqltrig.htm">SQL triggers</a></div>
<div><a href="../sqlp/rbafykickoff.htm">SQL programming</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="http://www.redbooks.ibm.com/abstracts/sg246503.html" target="_blank">Stored Procedures, Triggers and User Defined Functions on DB2 Universal Database for iSeries</a></div>
</div>
</div>
</body>
</html>