77 lines
5.2 KiB
HTML
77 lines
5.2 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="Example: Extract a document to a file" />
|
|
<meta name="abstract" content="This program example shows how character large object (CLOB) elements can be retrieved from a table into an external file." />
|
|
<meta name="description" content="This program example shows how character large object (CLOB) elements can be retrieved from a table into an external file." />
|
|
<meta name="DC.subject" content="LOBs (Large Objects), file reference variables, examples of using, examples, extracting a document to a file (CLOB elements in a table)" />
|
|
<meta name="keywords" content="LOBs (Large Objects), file reference variables, examples of using, examples, extracting a document to a file (CLOB elements in a table)" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafylobs.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafylfilc.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafylfilb.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="rbafyexampextract" />
|
|
<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>Example: Extract a document to a file</title>
|
|
</head>
|
|
<body id="rbafyexampextract"><a name="rbafyexampextract"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example: Extract a document to a file</h1>
|
|
<div><p>This program example shows how character large object (CLOB)
|
|
elements can be retrieved from a table into an external file.</p>
|
|
<div class="section"><h4 class="sectiontitle">How the sample LOBFILE program works</h4> <ol><li><strong>Declare host variables.</strong> The BEGIN DECLARE SECTION and END DECLARE
|
|
SECTION statements delimit the host variable declarations. Host variables
|
|
are prefixed with a colon (:) when referenced in an SQL statement. A CLOB
|
|
FILE REFERENCE host variable is declared.</li>
|
|
<li><strong>CLOB FILE REFERENCE host variable is set up.</strong> The attributes of
|
|
the FILE REFERENCE are set up. A file name without a fully declared path
|
|
is, by default, placed in the user's current directory. If the path name does
|
|
not begin with the forward slash (/) character, it is not qualified.</li>
|
|
<li><strong>Select into the CLOB FILE REFERENCE host variable.</strong> The data from
|
|
the <samp class="codeph">resume</samp> field is selected into the file name that is referenced
|
|
by the host variable.</li>
|
|
</ol>
|
|
</div>
|
|
<div class="section"><p>The <samp class="codeph">CHECKERR</samp> macro/function is an error checking
|
|
utility which is external to the program. The location of this error checking
|
|
utility depends on the programming language used:</p>
|
|
<dl><dt class="dlterm">C </dt>
|
|
<dd><samp class="codeph">check_error</samp> is redefined as <samp class="codeph">CHECKERR</samp> and
|
|
is located in the <samp class="codeph">util.c</samp> file. </dd>
|
|
<dt class="dlterm">COBOL </dt>
|
|
<dd><samp class="codeph">CHECKERR</samp> is an external program named <samp class="codeph">checkerr.cbl</samp>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div class="section"> <div class="note"><span class="notetitle">Note:</span> By using the code examples, you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="rbafylfilc.htm">Example: LOBFILE.SQC in C</a></strong><br />
|
|
</li>
|
|
<li class="ulchildlink"><strong><a href="rbafylfilb.htm">Example: LOBFILE.SQB in COBOL</a></strong><br />
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafylobs.htm" title="The VARCHAR, VARGRAPHIC, and VARBINARY data types have a limit of 32 KB (where KB equals 1024 bytes) of storage. While this may be sufficient for small to medium-size text data, applications often need to store large text documents. They might also need to store a wide variety of additional data types such as audio, video, drawings, mixed text and graphics, and images. There are three data types to store these data objects as strings of up to 2 GB (where GB equals 1 073 741 824 bytes).">Use large objects (LOBs)</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |