114 lines
6.9 KiB
HTML
114 lines
6.9 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="Declare host variables in ILE RPG applications that use SQL" />
|
|
<meta name="abstract" content="The SQL ILE RPG precompiler only recognizes a subset of valid ILE RPG declarations as valid host variable declarations." />
|
|
<meta name="description" content="The SQL ILE RPG precompiler only recognizes a subset of valid ILE RPG declarations as valid host variable declarations." />
|
|
<meta name="DC.subject" content="host variable, ILE RPG, declaring, ILE RPG program, date/time, Datetime host variable, ILE RPG, Datetime, precompiler parameter, DATFMT, DATSEP, TIMFMT, TIMSEP, ILE RPG" />
|
|
<meta name="keywords" content="host variable, ILE RPG, declaring, ILE RPG program, date/time, Datetime host variable, ILE RPG, Datetime, precompiler parameter, DATFMT, DATSEP, TIMFMT, TIMSEP, ILE RPG" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzajphostvariablesirpg.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzajpirpgbin.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzajplobvar.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzajpilerpgrowid.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="rzajpdeclaringirpg" />
|
|
<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>Declare host variables in ILE RPG applications that use SQL</title>
|
|
</head>
|
|
<body id="rzajpdeclaringirpg"><a name="rzajpdeclaringirpg"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Declare host variables in ILE RPG applications that use SQL</h1>
|
|
<div><p>The SQL ILE RPG precompiler only recognizes a subset of valid ILE
|
|
RPG declarations as valid host variable declarations.</p>
|
|
<div class="section"><p>Most variables defined in ILE RPG can be used in SQL statements.
|
|
A partial listing of variables that are not supported includes the following:
|
|
</p>
|
|
<ul><li>Unsigned integers</li>
|
|
<li>Pointer</li>
|
|
<li>Tables</li>
|
|
<li>UDATE</li>
|
|
<li>UDAY</li>
|
|
<li>UMONTH</li>
|
|
<li>UYEAR</li>
|
|
<li>Look-ahead fields</li>
|
|
<li>Named constants</li>
|
|
<li>Multiple dimension arrays</li>
|
|
<li>Definitions requiring the resolution of %SIZE or %ELEM</li>
|
|
<li>Definitions requiring the resolution of constants unless the constant
|
|
is used in OCCURS or DIM.</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section"><p>Fields used as host variables are passed to SQL using the CALL/PARM
|
|
functions of ILE RPG. If a field cannot be used in the result field of the
|
|
PARM, it cannot be used as a host variable.</p>
|
|
</div>
|
|
<div class="section"><p>Date and time host variables are always assigned to corresponding
|
|
date and time subfields in the structures generated by the SQL precompiler.
|
|
The generated date and time subfields are declared using the format and separator
|
|
specified by the DATFMT, DATSEP, TIMFMT, and TIMSEP parameters on the CRTSQLRPGI
|
|
command or with the SET OPTION statement. Conversion from the user declared
|
|
host variable format to the precompile specified format occurs on assignment
|
|
to and from the SQL generated structure. If the DATFMT parameter value is
|
|
a system format (*MDY, *YMD, *DMY, or *JUL), then all input and output host
|
|
variables must contain date values within the range 1940-2039. If any date
|
|
value is outside of this range, then the DATFMT on the precompile must be
|
|
specified as one of the IBM<sup>®</sup> SQL formats of *ISO, *USA, *EUR, or *JIS.</p>
|
|
</div>
|
|
<div class="section"><p>Graphic host variables will use the RPG CCSID value if one is
|
|
specified. An SQL DECLARE VARIABLE statement cannot be used to change the
|
|
CCSID of a host variable whose CCSID has been defined in RPG, or a host variable
|
|
that is defined as UCS-2 or UTF-16.</p>
|
|
</div>
|
|
<div class="section"><p>The precompiler will generate an RPG logical (indicator) variable
|
|
as a character of length 1. This type can be used wherever SQL allows a character
|
|
host variable. It cannot be used as an SQL indicator variable. It is up to
|
|
the user to make sure that only values of 1 or 0 are assigned to it.</p>
|
|
</div>
|
|
<div class="section"><p>The precompiler supports EXTNAME(filename : fmtname), but does
|
|
not support EXTNAME(filename : fmtname : fieldtype), where fieldtype is *ALL,
|
|
*INPUT, *OUTPUT, or *KEY.</p>
|
|
</div>
|
|
<div class="section"><p>The precompiler supports LIKEREC(intrecname), but does not support
|
|
the optional second parameter.</p>
|
|
</div>
|
|
<div class="section"><p>If there is an unnamed subfield, the precompiler will not allow
|
|
the data structure containing the subfield to be used in the blocked fetch
|
|
and blocked insert statements. For all other SQL statements where the data
|
|
structure containing the subfield is used, only the subfields that are named
|
|
will be used. </p>
|
|
</div>
|
|
<div class="section"><p>If the PREFIX keyword has a prefix that contains a period, the
|
|
precompiler will not recognize the externally described file.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="rzajpirpgbin.htm">Declare binary host variables in ILE RPG applications that use SQL</a></strong><br />
|
|
ILE RPG does not have variables that correspond to the SQL binary data types.</li>
|
|
<li class="ulchildlink"><strong><a href="rzajplobvar.htm">Declare LOB host variables in ILE RPG applications that use SQL</a></strong><br />
|
|
ILE RPG does not have variables that correspond to the SQL data types for LOBs (large objects).</li>
|
|
<li class="ulchildlink"><strong><a href="rzajpilerpgrowid.htm">Declare ROWID variables in ILE RPG applications that use SQL</a></strong><br />
|
|
ILE RPG does not have a variable that corresponds to the SQL data type ROWID.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajphostvariablesirpg.htm" title="All host variables used in SQL statements must be explicitly declared.">Use host variables in ILE RPG applications that use SQL</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |