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

90 lines
5.7 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="Normalization" />
<meta name="abstract" content="Normalization allows you to compare strings that contain combining characters." />
<meta name="description" content="Normalization allows you to compare strings that contain combining characters." />
<meta name="DC.Relation" scheme="URI" content="rbafyussisql.htm" />
<meta name="DC.Relation" scheme="URI" content="../rzajq/qryoptf.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="rbafynormal" />
<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>Normalization </title>
</head>
<body id="rbafynormal"><a name="rbafynormal"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Normalization </h1>
<div><p>Normalization allows you to compare strings that contain combining
characters.</p>
<div class="section"><p> Data tagged with a UTF-8 or UTF-16 CCSID can contain combining
characters. Combining characters allow a resulting character to be composed
of more than one character. After the first character of the compound character,
one of many different non-spacing characters such as umlauts and accents can
follow in the data string. If the resulting character is one that is already
defined in the character set, normalization of the string results in multiple
combining characters being replaced by the value of the defined character.
For example, if your string contained the letter 'a' followed by an '..',
the string is normalized to contain the single character 'ä'.</p>
</div>
<div class="section"><p>Normalization makes it possible to accurately compare strings.
If data is not normalized, two strings that look identical on the display
may not compare equal since the stored representation can be different. When
UTF-8 and UTF-16 string data is not normalized, it is possible that a column
in a table can have one row with the letter 'a' followed by the umlaut character
and another row with the combined 'ä' character. These two values are not
both compare equal in a comparison predicate: WHERE C1 = 'ä'. For this reason,
it is recommended that all string columns in a table are stored in normalized
form.</p>
</div>
<div class="section"><p>You can normalize the data yourself before inserting or updating
it, or you can define a column in a table to be automatically normalized by
the database. To have the database perform the normalization, specify NORMALIZED
as part of the column definition. This option is only allowed for columns
that are tagged with a CCSID of 1208 (UTF-8) or 1200 (UTF-16). The database
assumes all columns in a table have been normalized.</p>
</div>
<div class="section"><p>The NORMALIZED clause can also be specified for function and procedure
parameters. If it is specified for an input parameter, the normalization
will be done by the database for the parameter value before invoking the function
or procedure. If it is specified for an output parameter, the clause is not
enforced; it is assumed that the user's routine code will return a normalized
value.</p>
</div>
<div class="section"><p>The NORMALIZE_DATA option in the QAQQINI file is used to indicate
whether the system is to perform normalization when working with UTF-8 and
UTF-16 data. This option controls whether the system will normalize literals,
host variables, parameter markers, and expressions that combine strings before
using them in SQL. The option is initialized to not perform normalization.
This is the correct value for you if the data in your tables and any literal
values in your applications is always normalized already through some other
mechanism or never contains characters which will need to be normalized.
If this is the case, you will want to avoid the overhead of system normalization
in your query. If your data is not already normalized, you will want to switch
the value of this option to have the system perform normalization for you. </p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyussisql.htm" title="A sort sequence defines how characters in a character set relate to each other when they are compared or ordered. Normalization allows you to compare strings that contain combining characters.">Sort sequences and normalization in SQL</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../rzajq/qryoptf.htm">Change the attributes of your query with the Change Query Attributes (CHGQRYA) command</a></div>
</div>
</div>
</body>
</html>