107 lines
5.7 KiB
HTML
107 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="concept" />
|
||
|
<meta name="DC.Title" content="SQL conversion rules" />
|
||
|
<meta name="abstract" content="When two strings are compared, one of the strings is first converted, if necessary, to the coded character set of the other string." />
|
||
|
<meta name="description" content="When two strings are compared, one of the strings is first converted, if necessary, to the coded character set of the other string." />
|
||
|
<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="rbagssqlconversrules" />
|
||
|
<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 conversion rules</title>
|
||
|
</head>
|
||
|
<body id="rbagssqlconversrules"><a name="rbagssqlconversrules"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">SQL conversion rules</h1>
|
||
|
<div><p>When two strings are compared, one of the strings is first converted,
|
||
|
if necessary, to the coded character set of the other string.</p>
|
||
|
<p>Character conversion is necessary only if all of the following
|
||
|
conditions are true:</p>
|
||
|
<ul><li>The CCSIDs of the two strings are different.</li>
|
||
|
<li>Neither CCSID is 65535.</li>
|
||
|
<li>The string selected for conversion is neither null nor empty.</li>
|
||
|
<li>The CCSID conversion selection table indicates that conversion is necessary.</li>
|
||
|
</ul>
|
||
|
<p>If one string has an SBCS CCSID and the other is the same type of operand
|
||
|
and has a mixed data CCSID, the SBCS data character string is converted. Otherwise,
|
||
|
the string selected for conversion depends on the type of each operand. The
|
||
|
following table shows which operand is selected for conversion, given the
|
||
|
operand types.</p>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" id="d0e35">First operand</th>
|
||
|
<th valign="top" id="d0e37">Column value (second operand)</th>
|
||
|
<th valign="top" id="d0e39">Derived value (second operand)</th>
|
||
|
<th valign="top" id="d0e41">Special register (second operand)</th>
|
||
|
<th valign="top" id="d0e43">Constant (second operand)</th>
|
||
|
<th valign="top" id="d0e45">Host variable (second operand)</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e35 ">Column value</td>
|
||
|
<td valign="top" headers="d0e37 ">Second</td>
|
||
|
<td valign="top" headers="d0e39 ">Second</td>
|
||
|
<td valign="top" headers="d0e41 ">Second</td>
|
||
|
<td valign="top" headers="d0e43 ">Second</td>
|
||
|
<td valign="top" headers="d0e45 ">Second</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e35 ">Derived Value</td>
|
||
|
<td valign="top" headers="d0e37 ">First</td>
|
||
|
<td valign="top" headers="d0e39 ">Second</td>
|
||
|
<td valign="top" headers="d0e41 ">Second</td>
|
||
|
<td valign="top" headers="d0e43 ">Second</td>
|
||
|
<td valign="top" headers="d0e45 ">Second</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e35 ">Special Register</td>
|
||
|
<td valign="top" headers="d0e37 ">First</td>
|
||
|
<td valign="top" headers="d0e39 ">First</td>
|
||
|
<td valign="top" headers="d0e41 ">Second</td>
|
||
|
<td valign="top" headers="d0e43 ">Second</td>
|
||
|
<td valign="top" headers="d0e45 ">Second</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e35 ">Constant</td>
|
||
|
<td valign="top" headers="d0e37 ">First</td>
|
||
|
<td valign="top" headers="d0e39 ">First</td>
|
||
|
<td valign="top" headers="d0e41 ">First</td>
|
||
|
<td valign="top" headers="d0e43 ">Second</td>
|
||
|
<td valign="top" headers="d0e45 ">Second</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e35 ">Host Variable</td>
|
||
|
<td valign="top" headers="d0e37 ">First</td>
|
||
|
<td valign="top" headers="d0e39 ">First</td>
|
||
|
<td valign="top" headers="d0e41 ">First</td>
|
||
|
<td valign="top" headers="d0e43 ">First</td>
|
||
|
<td valign="top" headers="d0e45 ">Second</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<p>A host variable containing data in a foreign encoding scheme is always
|
||
|
effectively converted to the native encoding scheme before it is used in any
|
||
|
operation. The previous rules are based on the assumption that
|
||
|
this conversion has already occurred.</p>
|
||
|
<p>An error occurs if a character of the string cannot be converted or the
|
||
|
CCSID Conversion Selection Table is used but does not contain any information
|
||
|
about the pair of CCSIDs. A warning occurs if a character of the string is
|
||
|
converted to the substitution character.</p>
|
||
|
</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>
|