ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzajp_5.4.0.1/rzajpplilob.htm

144 lines
8.6 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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="LOB host variables in PL/I applications that use SQL" />
<meta name="abstract" content="PL/I does not have variables that correspond to the SQL data types for LOBs (large objects). To create host variables that can be used with these data types, use the SQL TYPE IS clause. The SQL precompiler replaces this declaration with a PL/I language structure in the output source member." />
<meta name="description" content="PL/I does not have variables that correspond to the SQL data types for LOBs (large objects). To create host variables that can be used with these data types, use the SQL TYPE IS clause. The SQL precompiler replaces this declaration with a PL/I language structure in the output source member." />
<meta name="DC.subject" content="LOB host variable, PL/I, host variable, LOB, PL/I program, CLOB host variable, host variable, CLOB, BLOB host variable, BLOB, LOB locator, locator, LOB file reference variable, file reference variable" />
<meta name="keywords" content="LOB host variable, PL/I, host variable, LOB, PL/I program, CLOB host variable, host variable, CLOB, BLOB host variable, BLOB, LOB locator, locator, LOB file reference variable, file reference variable" />
<meta name="DC.Relation" scheme="URI" content="rzajpdeclarehostpli.htm" />
<meta name="DC.Relation" scheme="URI" content="../sqlp/rbafylobrefvar.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="rzajpplilob" />
<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>LOB host variables in PL/I applications that use SQL</title>
</head>
<body id="rzajpplilob"><a name="rzajpplilob"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">LOB host variables in PL/I applications that use SQL</h1>
<div><p>PL/I does not have variables that correspond to the SQL data types
for LOBs (large objects). To create host variables that can be used with these
data types, use the SQL TYPE IS clause. The SQL precompiler replaces this
declaration with a PL/I language structure in the output source member.</p>
<div class="section"><p>The following figure shows the syntax for valid LOB host variables.</p>
</div>
<div class="section"><h4 class="sectiontitle">LOB</h4><pre><span><img src="./c.gif" border="0" alt="Read syntax diagram" longdesc="rzajpplilobsyn1.htm" /></span><a href="#d0e102"><img src="./c.gif" border="0" alt="Skip visual syntax diagram" /></a>
>>-+-DECLARE-+--+-<i>variable-name</i>-----------+--------------------->
   '-DCL-----' | .-,-------------. |   
    | V | |   
    '-(----<i>variable-name</i>-+--)-'   
>--SQL TYPE IS--+-CLOB-+--(--<i>lob-length</i>--+---+--)--;----------->&lt;
    '-BLOB-' '-K-'    
</pre><a name="d0e102"></a></div>
<div class="section"> <div class="note"><span class="notetitle">Notes:</span> <ol><li>For BLOB and CLOB, 1 ≤ lob-length ≤ 32,766</li>
<li>SQL TYPE IS, BLOB, CLOB can be in mixed case.</li>
</ol>
</div>
</div>
<div class="section"><h4 class="sectiontitle"><em>CLOB Example</em></h4><p>The following declaration: </p>
<pre>DCL MY_CLOB SQL TYPE IS CLOB(16384);</pre>
</div>
<div class="section"><p>Results in the generation of the following structure: </p>
<pre>DCL 1 MY_CLOB,
3 MY_CLOB_LENGTH BINARY FIXED (31) UNALIGNED,
3 MY_CLOB_DATA CHARACTER (16384);</pre>
</div>
<div class="section"><h4 class="sectiontitle"><em>BLOB Example</em></h4><p>The following declaration: </p>
<pre>DCL MY_BLOB SQL TYPE IS BLOB(16384);</pre>
</div>
<div class="section"><p>Results in the generation of the following structure: </p>
<pre>DCL 1 MY_BLOB,
3 MY_BLOB_LENGTH BINARY FIXED (31) UNALIGNED,
3 MY_BLOB_DATA CHARACTER (16384);</pre>
</div>
<div class="section"><p>The following figure shows the syntax for valid LOB locators.</p>
</div>
<div class="section"><h4 class="sectiontitle">LOB locator</h4><pre><span><img src="./c.gif" border="0" alt="Read syntax diagram" longdesc="rzajpplilobsyn2.htm" /></span><a href="#d0e182"><img src="./c.gif" border="0" alt="Skip visual syntax diagram" /></a>
>>-+-DECLARE-+--+-<i>variable-name</i>-----------+--------------------->
   '-DCL-----' | .-,-------------. |   
    | V | |   
    '-(----<i>variable-name</i>-+--)-'   
>--SQL TYPE IS--+-CLOB_LOCATOR---+--;-------------------------->&lt;
    +-DBCLOB_LOCATOR-+    
    '-BLOB_LOCATOR---'    
</pre><a name="d0e182"></a></div>
<div class="section"> <div class="note"><span class="notetitle">Note:</span> SQL TYPE IS, BLOB_LOCATOR, CLOB_LOCATOR, DBCLOB_LOCATOR can
be in mixed case.</div>
</div>
<div class="section"><h4 class="sectiontitle"><em>CLOB Locator Example</em></h4><p>The following declaration: </p>
<pre>DCL MY_LOCATOR SQL TYPE IS CLOB_LOCATOR;</pre>
</div>
<div class="section"><p>Results in the following generation: </p>
<pre>DCL MY_LOCATOR BINARY FIXED(31) UNALIGNED;</pre>
</div>
<div class="section"><p>BLOB and DBCLOB locators have similar syntax.</p>
</div>
<div class="section"><p>The following figure shows the syntax for valid LOB file reference
variables.</p>
</div>
<div class="section"><h4 class="sectiontitle">LOB file reference variable</h4><pre><span><img src="./c.gif" border="0" alt="Read syntax diagram" longdesc="rzajpplilobsyn3.htm" /></span><a href="#d0e239"><img src="./c.gif" border="0" alt="Skip visual syntax diagram" /></a>
>>-+-DECLARE-+--+-<i>variable-name</i>-----------+--------------------->
   '-DCL-----' | .-,-------------. |   
    | V | |   
    '-(----<i>variable-name</i>-+--)-'   
>--SQL TYPE IS--+-CLOB_FILE---+--;----------------------------->&lt;
    +-DBCLOB_FILE-+    
    '-BLOB_FILE---'    
</pre><a name="d0e239"></a></div>
<div class="section"> <div class="note"><span class="notetitle">Note:</span> SQL TYPE IS, BLOB_FILE, CLOB_FILE, and DBCLOB_FILE can be
in mixed case.</div>
</div>
<div class="section"><h4 class="sectiontitle"><em>CLOB File Reference Example</em></h4><p>The following
declaration:</p>
<pre>DCL MY_FILE SQL TYPE IS CLOB_FILE;</pre>
</div>
<div class="section"><p>Results in the generation of the following structure:</p>
<pre>DCL 1 MY_FILE,
3 MY_FILE_NAME_LENGTH BINARY FIXED(31) UNALIGNED,
3 MY_FILE_DATA_LENGTH BINARY FIXED(31) UNALIGNED,
3 MY_FILE_FILE_OPTIONS BINARY FIXED(31) UNALIGNED,
3 MY_FILE_NAME CHAR(255);</pre>
</div>
<div class="section"><p>BLOB and DBCLOB locators have similar syntax.</p>
</div>
<div class="section"><p>The pre-compiler will generate declarations for the following
file option constants: </p>
<ul><li>SQL_FILE_READ (2)</li>
<li>SQL_FILE_CREATE (8)</li>
<li>SQL_FILE_OVERWRITE (16)</li>
<li>SQL_FILE_APPEND (32)</li>
</ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzajpdeclarehostpli.htm" title="The PL/I precompilers only recognize a subset of valid PL/I declarations as valid host variable declarations.">Declare host variables in PL/I applications that use SQL</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../sqlp/rbafylobrefvar.htm">LOB file reference variables</a></div>
</div>
</div>
</body>
</html>