67 lines
4.5 KiB
HTML
67 lines
4.5 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="Insert multiple rows in a table with the blocked INSERT statement" />
|
||
|
<meta name="abstract" content="A blocked INSERT statement can be used to insert multiple rows into a table with a single statement." />
|
||
|
<meta name="description" content="A blocked INSERT statement can be used to insert multiple rows into a table with a single statement." />
|
||
|
<meta name="DC.subject" content="INSERT statement, inserting multiple rows, using blocked INSERT, row, inserting multiple using blocked INSERT, into a table, table, inserting multiple rows into, using blocked INSERT, examples, inserting multiple rows, using blocked INSERT" />
|
||
|
<meta name="keywords" content="INSERT statement, inserting multiple rows, using blocked INSERT, row, inserting multiple using blocked INSERT, into a table, table, inserting multiple rows into, using blocked INSERT, examples, inserting multiple rows, using blocked INSERT" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafyinsert.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../rzajp/rzajpkickoff.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="rbafyblkins" />
|
||
|
<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>Insert multiple rows in a table with the blocked INSERT statement</title>
|
||
|
</head>
|
||
|
<body id="rbafyblkins"><a name="rbafyblkins"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Insert multiple rows in a table with the blocked INSERT statement</h1>
|
||
|
<div><p>A blocked INSERT statement can be used to insert multiple
|
||
|
rows into a table with a single statement.</p>
|
||
|
<div class="section"><p>The blocked INSERT statement is supported in all of the languages
|
||
|
except REXX. The data inserted into the table must be in a host structure
|
||
|
array. If indicator variables are used with a blocked INSERT, they must also
|
||
|
be in a host structure array. </p>
|
||
|
</div>
|
||
|
<div class="section"><p>For example, to add ten employees to the CORPDATA.EMPLOYEE table:</p>
|
||
|
<pre> <strong>INSERT INTO</strong> CORPDATA.EMPLOYEE
|
||
|
(EMPNO,FIRSTNME,MIDINIT,LASTNAME,WORKDEPT)
|
||
|
10 <strong>ROWS VALUES</strong>(:DSTRUCT:ISTRUCT)</pre>
|
||
|
</div>
|
||
|
<div class="section"><p>DSTRUCT is a host structure array with five elements that is declared
|
||
|
in the program. The five elements correspond to EMPNO, FIRSTNME, MIDINIT,
|
||
|
LASTNAME, and WORKDEPT. DSTRUCT has a dimension of at least ten to accommodate
|
||
|
inserting ten rows. ISTRUCT is a host structure array that is declared in
|
||
|
the program. ISTRUCT has a dimension of at least ten small integer fields
|
||
|
for the indicators.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>Blocked INSERT statements are supported for non-distributed SQL
|
||
|
applications and for distributed applications where both the application server
|
||
|
and the application requester are <span class="keyword">iSeries™</span> systems.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyinsert.htm" title="This topic shows the basic SQL statements and clauses that insert data into tables and views. Examples using these SQL statements are supplied to help you develop SQL applications.">Insert rows using the INSERT statement</a></div>
|
||
|
</div>
|
||
|
<div class="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../rzajp/rzajpkickoff.htm">Embedded SQL programming</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|