ibm-information-center/dist/eclipse/plugins/i5OS.ic.sqlp_5.4.0.1/rbafyroutines.htm

69 lines
4.6 KiB
HTML

<?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="Routines" />
<meta name="abstract" content="Routines are pieces of code or programs that you can call to perform operations." />
<meta name="description" content="Routines are pieces of code or programs that you can call to perform operations." />
<meta name="DC.Relation" scheme="URI" content="rbafykickoff.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafysproeg.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyudf.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafydb2triggers.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafydebugproc.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafyudfperf.htm" />
<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="rbafyroutines" />
<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>Routines</title>
</head>
<body id="rbafyroutines"><a name="rbafyroutines"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Routines</h1>
<div><p>Routines are pieces of code or programs that you can call to perform
operations.</p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbafysproeg.htm">Stored procedures</a></strong><br />
A <em>procedure</em> (often called a stored procedure) is a program
that can be called to perform operations that can include both host language
statements and SQL statements. Procedures in SQL provide the same benefits
as procedures in a host language.</li>
<li class="ulchildlink"><strong><a href="rbafyudf.htm">Use user-defined functions (UDFs)</a></strong><br />
In writing SQL applications, you can implement some actions or operations as a UDF or as a subroutine in your application: Although it may appear easier to implement new operations as subroutines in your application, you might want to consider the advantages of using a UDF instead.</li>
<li class="ulchildlink"><strong><a href="rbafydb2triggers.htm">Triggers</a></strong><br />
A <em>trigger</em> is a set of actions that are run automatically
when a specified change operation is performed on a specified table or view.
The change operation can be an SQL INSERT, UPDATE, or DELETE statement, or
an insert, update, or delete high-level language statement in an application
program. Triggers are useful for tasks such as enforcing business rules, validating
input data, and keeping an audit trail.</li>
<li class="ulchildlink"><strong><a href="rbafydebugproc.htm">Debug an SQL routine</a></strong><br />
By specifying SET OPTION DBGVIEW = *SOURCE in your Create SQL Procedure, Create SQL Function, or Create Trigger statement, you can debug the generated program or module at the SQL statement level.</li>
<li class="ulchildlink"><strong><a href="rbafyudfperf.htm">Improve performance of procedures and functions</a></strong><br />
When creating stored procedures and user-defined functions (UDFs),
the SQL procedural language processor on the iSeries™ does not always generate the
most efficient code. However, you can do some changes to reduce the number
of database engine calls needed and improve performance. </li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafykickoff.htm" title="These topics describe the iSeries server implementation of the Structured Query Language (SQL) using DB2 UDB for iSeries and the DB2 UDB Query Manager and SQL Development Kit Version 5 licensed program.">SQL programming</a></div>
</div>
</div>
</body>
</html>