82 lines
5.6 KiB
HTML
82 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="Precompile programs with SQL statements" />
|
|
<meta name="abstract" content="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." />
|
|
<meta name="description" content="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." />
|
|
<meta name="DC.subject" content="application program, precompiling, precompile process, overview, SQL statement" />
|
|
<meta name="keywords" content="application program, precompiling, precompile process, overview, SQL statement" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1pdrdp.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1listing.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1tempmem.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1packcreation.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1prcpcmd.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal1compil.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="rbal1precsql" />
|
|
<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>Precompile programs with SQL statements</title>
|
|
</head>
|
|
<body id="rbal1precsql"><a name="rbal1precsql"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Precompile programs with SQL statements</h1>
|
|
<div><p>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.</p>
|
|
<p>The SQL precompiler scans each statement of the application program source
|
|
and does the following things:</p>
|
|
<ul><li>Looks for SQL statements and for the definition of host variable names</li>
|
|
<li>Verifies that each SQL statement is valid and free of syntax errors</li>
|
|
<li>Validates the SQL statements using the description in the database</li>
|
|
<li>Prepares each SQL statement for compilation in the host language</li>
|
|
<li>Produces information about each precompiled SQL statement</li>
|
|
</ul>
|
|
<p>Application programming statements and embedded SQL statements are the
|
|
primary input to the SQL precompiler. The SQL precompiler assumes that the
|
|
host language statements are syntactically correct. If the host language statements
|
|
are not syntactically correct, the precompiler might not correctly identify
|
|
SQL statements and host variable declarations.</p>
|
|
<p>The SQL precompile process produces a listing and a temporary source file
|
|
member. It can also produce the SQL package depending on what is specified
|
|
for the OPTION and RDB parameters of the precompiler command.</p>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="rbal1listing.htm">Listing</a></strong><br />
|
|
The output listing is sent to the printer file specified by the
|
|
PRTFILE parameter of the CRTSQL<em>xxx</em> command.</li>
|
|
<li class="ulchildlink"><strong><a href="rbal1tempmem.htm">Temporary source file member</a></strong><br />
|
|
Source statements processed by the precompiler are written to QSQLTEMP
|
|
in the QTEMP library (QSQLTEMP1 in the QTEMP library for programs created
|
|
using <span class="cmdname">CRTSQLRPGI</span>).</li>
|
|
<li class="ulchildlink"><strong><a href="rbal1packcreation.htm">SQL package creation</a></strong><br />
|
|
An object called an SQL package can be created as part of the precompile process when the CRTSQLxxx command is compiled.</li>
|
|
<li class="ulchildlink"><strong><a href="rbal1prcpcmd.htm">Precompiler commands</a></strong><br />
|
|
The <span class="keyword">DB2<sup>®</sup> UDB Query Manager and SQL Development Kit</span> licensed
|
|
program has seven precompiler commands, one for each of the host languages.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal1pdrdp.htm" title="When you write a program using SQL, you can embed the SQL statements in a host program.">Prepare distributed relational database programs</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="rbal1compil.htm" title="The DB2 Universal Database for iSeries precompiler automatically calls the host language compiler after successfully precompiling the program, unless the *NOGEN precompiler option is specified.">Compile an application program</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |