83 lines
5.6 KiB
HTML
83 lines
5.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="Prepare distributed relational database programs" />
|
|
<meta name="abstract" content="When you write a program using SQL, you can embed the SQL statements in a host program." />
|
|
<meta name="description" content="When you write a program using SQL, you can embed the SQL statements in a host program." />
|
|
<meta name="DC.subject" content="host program, definition, host variables, application program, host variable" />
|
|
<meta name="keywords" content="host program, definition, host variables, application program, host variable" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1program.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1precsql.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1compil.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1bind.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1tdebug.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="rbal1pdrdp" />
|
|
<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>Prepare distributed relational database programs</title>
|
|
</head>
|
|
<body id="rbal1pdrdp"><a name="rbal1pdrdp"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Prepare distributed relational database programs</h1>
|
|
<div><p>When you write a program using SQL, you can embed the SQL statements
|
|
in a host program. </p>
|
|
<p>The <dfn class="term">host program</dfn> is the program that contains the SQL statements,
|
|
written in one of the <dfn class="term">host languages</dfn>: the <span class="keyword">iSeries™</span> PL/I,
|
|
ILE C/400<sup>®</sup>, COBOL/400<sup>®</sup>,
|
|
ILE COBOL/400,
|
|
FORTRAN/400, RPG/400<sup>®</sup>,
|
|
or ILE RPG/400 programming
|
|
language. In a host program you use variables referred to as <dfn class="term">host variables</dfn>.
|
|
These are variables used in SQL statements that are identifiable to the host
|
|
program. In RPG, this is called a <em>field name</em>; in FORTRAN, PL/I, and
|
|
C, this is known as a <em>variable</em>; in COBOL, this is called a <em>data
|
|
item</em>.</p>
|
|
<p>You can code your distributed <span class="keyword">DB2 Universal Database™ for iSeries</span> programs
|
|
in a way similar to the coding for a <span class="keyword">DB2<sup>®</sup> UDB for iSeries</span> program
|
|
that is not distributed. You use the host language to embed the SQL statements
|
|
with the host variables. Also, like a <span class="keyword">DB2 UDB for iSeries</span> program
|
|
that is not distributed, a distributed <span class="keyword">DB2 UDB for iSeries</span> program
|
|
is prepared using the certain processes.</p>
|
|
<p>However, a distributed <span class="keyword">DB2 UDB for iSeries</span> program
|
|
also requires that an SQL package is created on the application server (AS)
|
|
to access data.</p>
|
|
<p>This topic collection discusses these steps in the process, outlining the
|
|
differences for a distributed <span class="keyword">DB2 UDB for iSeries</span> program.</p>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="rbal1precsql.htm">Precompile programs with SQL statements</a></strong><br />
|
|
You must precompile and compile an application program containing embedded SQL statements before you can run it. Precompiling such programs is done by an SQL precompiler.</li>
|
|
<li class="ulchildlink"><strong><a href="rbal1compil.htm">Compile an application program</a></strong><br />
|
|
The <span class="keyword">DB2 Universal Database for iSeries</span> precompiler
|
|
automatically calls the host language compiler after successfully
|
|
precompiling the program, unless the *NOGEN precompiler option is specified.</li>
|
|
<li class="ulchildlink"><strong><a href="rbal1bind.htm">Bind an application</a></strong><br />
|
|
Before you can run your application program, a relationship between
|
|
the program and any referred-to tables and views must be established. This
|
|
process is called <dfn class="term">binding</dfn>.</li>
|
|
<li class="ulchildlink"><strong><a href="rbal1tdebug.htm">Testing and debugging</a></strong><br />
|
|
Testing and debugging distributed SQL programs is similar to testing and debugging local SQL programs, but certain aspects of the process are different.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal1program.htm" title="Programmers can write high-level language programs that use SQL statements for iSeries distributed application programs.">Application development</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |