ibm-information-center/dist/eclipse/plugins/i5OS.ic.dbp_5.4.0.1/rbafoandbr.htm

89 lines
6.4 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="concept" />
<meta name="DC.Title" content="Add database records" />
<meta name="abstract" content="The write operation allows you to add a new record to a physical database file member." />
<meta name="description" content="The write operation allows you to add a new record to a physical database file member." />
<meta name="DC.subject" content="database record, adding, record" />
<meta name="keywords" content="database record, adding, record" />
<meta name="DC.Relation" scheme="URI" content="rbafobasicop.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafoformt.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafofeodop.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforsdlt.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahftra.htm" />
<meta name="DC.Relation" scheme="URI" content="rbaforzahfrca.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="rbafoandbr" />
<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>Add database records</title>
</head>
<body id="rbafoandbr"><a name="rbafoandbr"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Add database records</h1>
<div><p>The write operation allows you to add a new record to a physical
database file member.</p>
<p>The WRITE statement in the RPG/400<sup>®</sup> language and the WRITE statement
in the COBOL/400<sup>®</sup> language
are examples of this operation. New records can be added to a physical file
member or to a logical file member that is based on the physical file member.
When using a multiple format logical file, a record format name must be supplied
to tell the system which physical file member to add the record to.</p>
<p>The new record is normally added at the end of the physical file member.
The next available relative record number (including deleted records) is assigned
to the new record. Some high-level languages allow you to write a new record
over a deleted record position (for example, the WRITE statement in COBOL/400 when
the file organization is defined as RELATIVE). For more information about
writing records over deleted record positions, see your high-level language
topic collection.</p>
<p>If the physical file to which records are added reuses deleted records,
the system tries to insert the records into slots that held deleted records.
Before you create or change a file to reuse deleted records, you should review
the restrictions and tips for use to determine whether the file is a candidate
for reuse of deleted record space.</p>
<p>If you are adding new records to a file member that has a keyed access
path, the new record appears in the keyed sequence access path immediately
at the location defined by the record key. If you are adding records to a
logical member that contains select/omit values, the omit values can prevent
the new record from appearing in the member's access path.</p>
<p>If the file to which you are adding a record has an insert trigger associated
with it, the trigger program is called before or after inserting the record.</p>
<p>If the files you are adding to are associated with referential constraints,
record insertion can be affected.</p>
<p>The SIZE parameter on the Create Physical File (CRTPF) and Create Source
Physical File (CRTSRCPF) commands determines how many records can be added
to a physical file member.</p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rbafoformt.htm">Identify which record format to add in a file with multiple formats</a></strong><br />
If your application uses a file name instead of a record format name for records to be added to the database, and if the file used is a logical file with more than one record format, you need to write a format selector program to determine where a record should be placed in the database.</li>
<li class="ulchildlink"><strong><a href="rbafofeodop.htm">Use the force-end-of-data operation</a></strong><br />
The force-end-of-data (FEOD) operation allows you to force all changes that were made to a file by your program to auxiliary storage. It also allows you to position the read operation to either the beginning or the end of a file if the file is open for input operations.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafobasicop.htm" title="These topics describe basic database file operations, including the read, update, write and delete operations.">Basic database file operations in programs</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rbaforsdlt.htm" title="Sometimes you might want to reuse deleted records for your database files. In this case, you can use the REUSEDLT parameter.">Reuse deleted records</a></div>
<div><a href="rbaforzahftra.htm" title="A trigger is a set of actions that run automatically when a specified change or read operation is performed on a specified database file. On iSeries, you define a set of trigger actions in any supported high-level language.">Trigger automatic events in your database</a></div>
<div><a href="rbaforzahfrca.htm" title="These topics discuss how to use referential constraints in your database to ensure that it contains only valid data.">Ensure data integrity with referential constraints</a></div>
</div>
</div>
</body>
</html>