ibm-information-center/dist/eclipse/plugins/i5OS.ic.nls_5.4.0.1/rbagssqlasgncompdbcs.htm

62 lines
4.0 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="SQL assignments and comparisons" />
<meta name="abstract" content="The basic operations of SQL are assignment and comparison." />
<meta name="description" content="The basic operations of SQL are assignment and comparison." />
<meta name="DC.Relation" scheme="URI" content="rbagssqlanddbchars.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="rbagssqlasgncompdbcs" />
<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>SQL assignments and comparisons</title>
</head>
<body id="rbagssqlasgncompdbcs"><a name="rbagssqlasgncompdbcs"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQL assignments and comparisons</h1>
<div><p>The basic operations of SQL are assignment and comparison.</p>
<p>Assignment operations are performed during the running of CALL, INSERT,
UPDATE, FETCH, and SELECT INTO statements. Comparison operations are performed
during the running of statements that include predicates and other language
elements such as MAX, MIN, DISTINCT, GROUP BY, and ORDER BY.</p>
<p>The basic rule for both operations is that the data type of the operands
involved must be compatible. The compatibility rule also applies to UNION,
concatenation, and the VALUE, COALESCE, MIN, and MAX scalar functions.</p>
<div class="section" id="rbagssqlasgncompdbcs__HDRCHARAS"><a name="rbagssqlasgncompdbcs__HDRCHARAS"><!-- --></a><h4 class="sectiontitle">SQL string assignments and double-byte characters</h4><p>The
basic rule for string assignments is that the length of a string assigned
to a column must not be greater than the length attribute of the column. (Trailing
blanks are normally included in the length of the string. For string assignment,
however, trailing blanks are not included in the length of the string.)</p>
<p>If
the string contains mixed data, the assignment rules may require truncation
within a sequence of double-byte codes. To prevent the loss of the shift-in
character that ends the double-byte sequence, additional characters might
be truncated from the end of the string, and a shift-in character added. In
the truncated result, there is always an even number of bytes between each
shift-out character and its matching shift-in character.</p>
<p>Character,
DBCS-only, DBCS-open, and DBCS-either are not compatible with graphic types
for assignment.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbagssqlanddbchars.htm" title="The basic symbols of keywords and operators in the SQL language are single-byte characters that are part of all character sets supported by the IBM relational database products. Characters of the language are classified as letters, digits, or special characters.">SQL and DBCS</a></div>
</div>
</div>
</body>
</html>