99 lines
6.8 KiB
HTML
99 lines
6.8 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="Field use" />
|
||
|
<meta name="abstract" content="When the grouping function is used, all fields in the record format for the open query file (FORMAT parameter) and all key fields (KEYFLD parameter) must be either grouping fields (specified on the GRPFLD parameter) or mapped fields (specified on the MAPFLD parameter)." />
|
||
|
<meta name="description" content="When the grouping function is used, all fields in the record format for the open query file (FORMAT parameter) and all key fields (KEYFLD parameter) must be either grouping fields (specified on the GRPFLD parameter) or mapped fields (specified on the MAPFLD parameter)." />
|
||
|
<meta name="DC.subject" content="field, considerations for field use" />
|
||
|
<meta name="keywords" content="field, considerations for field use" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafoopnqf.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="rbafooqfpcfld" />
|
||
|
<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>Field use</title>
|
||
|
</head>
|
||
|
<body id="rbafooqfpcfld"><a name="rbafooqfpcfld"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Field use</h1>
|
||
|
<div><p>When the grouping function is used, all fields in the record format
|
||
|
for the open query file (FORMAT parameter) and all key fields (KEYFLD parameter)
|
||
|
must be either grouping fields (specified on the GRPFLD parameter) or mapped
|
||
|
fields (specified on the MAPFLD parameter).</p>
|
||
|
<p>Mapped fields are defined using only grouping fields, constants, and aggregate
|
||
|
functions.</p>
|
||
|
<div class="p">The aggregate functions are: %AVG, %COUNT, %MAX (using only one operand),
|
||
|
%MIN (using only one operand), %STDDEV, %SUM, and %VAR. Group processing is
|
||
|
required in the following cases: <ul><li>When you specify grouping field names on the GRPFLD parameter</li>
|
||
|
<li>When you specify group selection values on the GRPSLT parameter</li>
|
||
|
<li>When a mapped field that you specified on the MAPFLD parameter uses an
|
||
|
aggregate function in its definition</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<p>Fields that have any of the large object data types: BLOB, CLOB, or DBCLOB,
|
||
|
can only be read using the Copy From Query File (CPYFRMQRYF) command or Structured
|
||
|
Query Language (SQL). Large object field data cannot be directly accessed
|
||
|
from an open query file. The CPYFRMQRYF command must be used to access large
|
||
|
object fields from an open query file. A field with a large object data type
|
||
|
(BLOB, CLOB or DBCLOB) cannot be specified on these OPNQRYF parameters: KEYFLD,
|
||
|
UNIQUEKEY, JFLD, and GRPFLD.</p>
|
||
|
<p>Fields of type DATALINK might not appear in selection, grouping, ordering,
|
||
|
or joins. If a DATALINK field appears in that format, it will be returned
|
||
|
in its unprocessed form, as it exists in the data space.</p>
|
||
|
<p>Fields contained in a record format, identified on the FILE parameter,
|
||
|
and defined (in the DDS used to create the file) with a usage value of N (neither
|
||
|
input nor output) cannot be specified on any parameter of the OPNQRYF command.
|
||
|
Only fields defined as either I (input-only) or B (both input and output)
|
||
|
usage can be specified. Any fields with usage defined as N in the record format
|
||
|
identified on the FORMAT parameter are ignored by the OPNQRYF command.</p>
|
||
|
<p>Fields in the open query file records normally have the same usage attribute
|
||
|
(input-only or both input and output) as the fields in the record format identified
|
||
|
on the FORMAT parameter, with the exceptions noted later in this topic. If
|
||
|
the file is opened for any option (OPTION parameter) that includes output
|
||
|
or update and any usage, and if any B (both input and output) field in the
|
||
|
record format identified on the FORMAT parameter is changed to I (input only)
|
||
|
in the open query file record format, then an information message is sent
|
||
|
by the OPNQRYF command.</p>
|
||
|
<div class="p">If you request join processing or group processing, or if you specify UNIQUEKEY
|
||
|
processing, all fields in the query records are given input-only use. Any
|
||
|
mapping from an input-only field from the file being processed (identified
|
||
|
on the FILE parameter) is given input-only use in the open query file record
|
||
|
format. Fields defined using the MAPFLD parameter are normally given input-only
|
||
|
use in the open query file. A field defined on the MAPFLD parameter is given
|
||
|
a value that matches the use of its constituent field if all of the following
|
||
|
conditions are true: <ul><li>Input-only is not required because of any of the conditions previously
|
||
|
described in this topic.</li>
|
||
|
<li>The field-definition expression specified on the MAPFLD parameter is a
|
||
|
field name (no operators or built-in functions).</li>
|
||
|
<li>The field used in the field-definition expression exists in one of the
|
||
|
file, member, or record formats specified on the FILE parameter (not in another
|
||
|
field defined using the MAPFLD parameter).</li>
|
||
|
<li>The base field and the mapped field are compatible field types (the mapping
|
||
|
does not mix numeric and character field types, unless the mapping is between
|
||
|
zoned and character fields of the same length).</li>
|
||
|
<li>If the base field is binary with nonzero decimal precision, the mapped
|
||
|
field must also be binary and have the same precision.</li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafoopnqf.htm" title="The Open Query File (OPNQRYF) command is a control language (CL) command that allows you to perform many data processing functions on database files. These topics discuss how to create a query using the OPNQRYF command, how to specify parameters for its major functions, and how to use it with your high-level language program.">Use Open Query File (OPNQRYF) command</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|