73 lines
5.7 KiB
HTML
73 lines
5.7 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="Embed SQL statements in PL/I applications that use SQL" />
|
||
|
<meta name="abstract" content="The first statement of the PL/I program must be a PROCEDURE statement." />
|
||
|
<meta name="description" content="The first statement of the PL/I program must be a PROCEDURE statement." />
|
||
|
<meta name="DC.subject" content="embedded SQL, PL/I" />
|
||
|
<meta name="keywords" content="embedded SQL, PL/I" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpplone.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpexampsqlpli.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpcommentspli.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpcontinuationpli.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpincludecodepli.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpmarginspli.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpplnamco.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpstmtlabelspli.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzajpwheneverpli.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="rzajpembedsqlpli" />
|
||
|
<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>Embed SQL statements in PL/I applications that use SQL</title>
|
||
|
</head>
|
||
|
<body id="rzajpembedsqlpli"><a name="rzajpembedsqlpli"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Embed SQL statements in PL/I applications that use SQL</h1>
|
||
|
<div><p>The first statement of the PL/I program must be a PROCEDURE statement.</p>
|
||
|
<p>SQL statements can be coded in a PL/I program wherever executable statements
|
||
|
can appear.</p>
|
||
|
<p>Each SQL statement in a PL/I program must begin with EXEC SQL and end with
|
||
|
a semicolon (;). The key words EXEC SQL must appear all on one line, but the
|
||
|
remainder of the statement can appear on the next and subsequent lines.</p>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rzajpexampsqlpli.htm">Example: Embed SQL statements in PL/I applications that use SQL</a></strong><br />
|
||
|
An UPDATE statement coded in a PL/I program might be coded as follows.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpcommentspli.htm">Comments in PL/I applications that use SQL</a></strong><br />
|
||
|
In addition to SQL comments (--), you can include PL/I comments (/*...*/) in embedded SQL statements wherever a blank is allowed, except between the keywords EXEC and SQL.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpcontinuationpli.htm">Continuation for SQL statements in PL/I applications that use SQL</a></strong><br />
|
||
|
The line continuation rules for SQL statements are the same as those for other PL/I statements, except that EXEC SQL must be specified within one line.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpincludecodepli.htm">Include code in PL/I applications that use SQL</a></strong><br />
|
||
|
SQL statements or PL/I host variable declaration statements can be included by placing the following SQL statement at the point in the source code where the statements are to be embedded.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpmarginspli.htm">Margins in PL/I applications that use SQL</a></strong><br />
|
||
|
Code SQL statements within the margins specified by the MARGINS parameter on the CRTSQLPLI command. If EXEC SQL does not start within the specified margins, the SQL precompiler will not recognize the SQL statement.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpplnamco.htm">Names in PL/I applications that use SQL</a></strong><br />
|
||
|
Any valid PL/I variable name can be used for a host variable and is subject to the following restrictions.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpstmtlabelspli.htm">Statement labels in PL/I applications that use SQL</a></strong><br />
|
||
|
All executable SQL statements, like PL/I statements, can have a label prefix.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rzajpwheneverpli.htm">WHENEVER Statement in PL/I applications that use SQL</a></strong><br />
|
||
|
The target for the GOTO clause in an SQL WHENEVER statement must be a label in the PL/I source code and must be within the scope of any SQL statements affected by the WHENEVER statement.</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajpplone.htm" title="This topic describes the unique application and coding requirements for embedding SQL statements in an iSeries PL/I program. Requirements for host structures and host variables are defined.">Code SQL statements in PL/I applications</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|