ibm-information-center/dist/eclipse/plugins/i5OS.ic.sqlp_5.4.0.1/rbafyexampinsertclob.htm

57 lines
3.9 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?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: Insert data into a CLOB column" />
<meta name="abstract" content="This example shows how to insert data from a regular file referenced by :hv_text_file into a CLOB column." />
<meta name="description" content="This example shows how to insert data from a regular file referenced by :hv_text_file into a CLOB column." />
<meta name="DC.subject" content="examples, inserting data into a CLOB column, LOBs (Large Objects), LOBEVAL.SQB COBOL program listing" />
<meta name="keywords" content="examples, inserting data into a CLOB column, LOBs (Large Objects), LOBEVAL.SQB COBOL program listing" />
<meta name="DC.Relation" scheme="URI" content="rbafylobs.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="rbafyexampinsertclob" />
<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: Insert data into a CLOB column</title>
</head>
<body id="rbafyexampinsertclob"><a name="rbafyexampinsertclob"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example: Insert data into a CLOB column</h1>
<div><p>This example shows how to insert data from a regular file referenced
by <samp class="codeph">:hv_text_file</samp> into a CLOB column.</p>
<div class="section"><p> In the path description of the following C program segment:</p>
<ul><li><samp class="codeph">userid</samp> represents the directory for one of your users.</li>
<li><samp class="codeph">dirname</samp> represents a subdirectory name of <span class="q">"userid"</span>.</li>
<li><samp class="codeph">filnam.1</samp> can become the name of one of your documents
that you want to insert into the table.</li>
<li><samp class="codeph">clobtab</samp> is the name of the table with the CLOB data type.</li>
</ul>
</div>
<div class="section"><pre> strcpy(hv_text_file.name, "/home/userid/dirname/filnam.1");
hv_text_file.name_length = strlen("/home/userid/dirname/filnam.1");
hv_text_file.file_options = SQL_FILE_READ; /* this is a 'regular' file */
EXEC SQL INSERT INTO CLOBTAB
VALUES(:hv_text_file);</pre>
</div>
</div>
<div>
<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>