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

65 lines
3.2 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="reference" />
<meta name="DC.Title" content="Source code for PGM2" />
<meta name="abstract" content="Here is the source code for PGM2." />
<meta name="description" content="Here is the source code for PGM2." />
<meta name="DC.Relation" scheme="URI" content="rbafyconnectmgmt.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="rbafydrdapgm2" />
<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>Source code for PGM2</title>
</head>
<body id="rbafydrdapgm2"><a name="rbafydrdapgm2"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Source code for PGM2</h1>
<div><p>Here is the source code for PGM2.</p>
<div class="example"> <div class="fignone"><span class="figcap">Figure 1. Source code for PGM2</span><pre>
EXEC SQL
<strong>CONNECT TO</strong> SYSC;
EXEC SQL
<strong>DECLARE</strong> C1 <strong>CURSOR FOR</strong>
<strong>SELECT</strong> ....;
EXEC SQL
<strong>OPEN</strong> C1;
do {
EXEC SQL
<strong>FETCH</strong> C1 <strong>INTO</strong> :st1;
EXEC SQL
<strong>UPDATE</strong> ...
<strong>SET</strong> COL1 = COL1+10
<strong>WHERE CURRENT OF</strong> C1;
PGM3(st1);
} while SQLCODE == 0;
EXEC SQL
<strong>CLOSE</strong> C1;
EXEC SQL <strong>COMMIT</strong>;
....</pre>
</div>
</div>
<div class="section"><p>Command to create program and SQL package for PGM2:</p>
<pre>CRTSQLCI OBJ(PGM2) COMMIT(*CHG) RDB(SYSC) OBJTYPE(*PGM)</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyconnectmgmt.htm" title="SQL connections are managed at the activation group level. Each activation group within a job manages its own connections and these connections are not shared across activation groups.">Connection management and activation groups</a></div>
</div>
</div>
</body>
</html>