102 lines
6.8 KiB
HTML
102 lines
6.8 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="Basic processes of the SQL precompiler" />
|
||
|
<meta name="abstract" content="You must precompile and compile an application program containing embedded SQL statements before you can run it." />
|
||
|
<meta name="description" content="You must precompile and compile an application program containing embedded SQL statements before you can run it." />
|
||
|
<meta name="DC.subject" content="process, basic, precompiler, basic process, embedded SQL, precompiling, precompiler parameter, RDB, Effect on precompile, complete diagnostics, OPTION(*SOURCE), OPTION(*XREF), OUTPUT" />
|
||
|
<meta name="keywords" content="process, basic, precompiler, basic process, embedded SQL, precompiling, precompiler parameter, RDB, Effect on precompile, complete diagnostics, OPTION(*SOURCE), OPTION(*XREF), OUTPUT" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajppreprog.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpinputcompile.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpsourceccsid.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpoutputcompile.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../dbp/rbafokickoff.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../dm/rbal3kickoff.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../db2/rbafzmst02.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="rzajpprecomp" />
|
||
|
<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>Basic processes of the SQL precompiler</title>
|
||
|
</head>
|
||
|
<body id="rzajpprecomp"><a name="rzajpprecomp"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Basic processes of the SQL precompiler</h1>
|
||
|
<div><p>You must precompile and compile an application program containing
|
||
|
embedded SQL statements before you can run it. </p>
|
||
|
<div class="note"><span class="notetitle">Note:</span> SQL statements in a REXX procedure are not precompiled and compiled.</div>
|
||
|
<p> Precompiling of such programs is done by the SQL precompiler. The SQL
|
||
|
precompiler scans each statement of the application program source and does
|
||
|
the following:</p>
|
||
|
<ul><li><strong>Looks for SQL statements and for the definition of host variable names.</strong> The
|
||
|
variable names and definitions are used to verify the SQL statements. You
|
||
|
can examine the listing after the SQL precompiler completes processing to
|
||
|
see if any errors occurred.</li>
|
||
|
<li><strong>Verifies that each SQL statement is valid and free of syntax errors.</strong> The
|
||
|
validation procedure supplies error messages in the output listing that help
|
||
|
you correct any errors that occur.</li>
|
||
|
<li><strong>Validates the SQL statements using the description in the database.</strong> During
|
||
|
the precompile, the SQL statements are checked for valid table, view, and
|
||
|
column names. If a specified table or view does not exist, or you are not
|
||
|
authorized to the table or view at the time of the precompile or compile,
|
||
|
the validation is done at run time. If the table or view does not exist at
|
||
|
run time, an error occurs. <div class="note"><span class="notetitle">Notes:</span> <ol><li>Overrides are processed when retrieving external definitions. </li>
|
||
|
<li>You need some authority (at least *OBJOPR) to any tables or views referred
|
||
|
to in the SQL statements in order to validate the SQL statements. The actual
|
||
|
authority required to process any SQL statement is checked at run time. </li>
|
||
|
<li>When the RDB parameter is specified on the CRTSQLxxx commands, the precompiler
|
||
|
accesses the specified relational database to obtain the table and view descriptions.</li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
</li>
|
||
|
<li><strong>Prepares each SQL statement for compilation in the host language.</strong> For
|
||
|
most SQL statements, the SQL precompiler inserts a comment and a CALL statement
|
||
|
to one of the SQL interface modules. For some SQL statements (for example,
|
||
|
DECLARE statements), the SQL precompiler produces no host language statement
|
||
|
except a comment.</li>
|
||
|
<li><strong>Produces information about each precompiled SQL statement.</strong> The
|
||
|
information is stored internally in a temporary source file member, where
|
||
|
it is available for use during the bind process.</li>
|
||
|
</ul>
|
||
|
<p>To get complete diagnostic information when you precompile, specify either
|
||
|
of the following:</p>
|
||
|
<ul><li>OPTION(*SOURCE *XREF) for CRTSQLxxx (where xxx=CBL, PLI, or RPG)</li>
|
||
|
<li>OPTION(*XREF) OUTPUT(*PRINT) for CRTSQLxxx (where xxx=CI, CPPI, CBLI,
|
||
|
or RPGI)</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rzajpinputcompile.htm">Input to the SQL precompiler</a></strong><br />
|
||
|
Application programming statements and embedded SQL statements are the primary input to the SQL precompiler.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpsourceccsid.htm">Source file CCSIDs in the SQL precompiler</a></strong><br />
|
||
|
The SQL precompiler reads the source records by using the CCSID of the source file.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpoutputcompile.htm">Output from the SQL precompiler</a></strong><br />
|
||
|
The following sections describe the various kinds of output supplied by the precompiler.</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajppreprog.htm" title="This topic describes some of the tasks for preparing and running an application program.">Prepare and run a program with SQL statements</a></div>
|
||
|
</div>
|
||
|
<div class="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../dbp/rbafokickoff.htm">Database programming</a></div>
|
||
|
<div><a href="../dm/rbal3kickoff.htm">Database file management</a></div>
|
||
|
<div><a href="../db2/rbafzmst02.htm">SQL reference</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|