99 lines
5.7 KiB
HTML
99 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="ODBC language considerations" />
|
||
|
<meta name="abstract" content="The ODBC Driver in iSeries Access for Linux handles many types of data conversions." />
|
||
|
<meta name="description" content="The ODBC Driver in iSeries Access for Linux handles many types of data conversions." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzatvodbc.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2004, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2004, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="languageodbc" />
|
||
|
<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>ODBC language considerations</title>
|
||
|
</head>
|
||
|
<body id="languageodbc"><a name="languageodbc"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">ODBC language considerations</h1>
|
||
|
<div><p>The ODBC Driver in iSeries™ Access for Linux<sup>®</sup> handles
|
||
|
many types of data conversions.</p>
|
||
|
<div class="section"><p>The character code page conversions involve using conversion tables
|
||
|
and the <samp class="codeph">iconv</samp> interfaces. Some of the conversion tables are
|
||
|
shipped with the driver, others are downloaded from the server when needed. <samp class="codeph">iconv</samp> is
|
||
|
a library shipped with Linux that also handles character data conversions.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Coded Character Set Identifiers (CCSID)</h4><p>The ODBC
|
||
|
Driver in iSeries Access
|
||
|
for Linux uses
|
||
|
a pair (to and from) of Coded Character Set Identifiers (CCSID) to convert
|
||
|
character data. The conversion uses a conversion table or the <samp class="codeph">iconv</samp> interfaces.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Conversion Tables</h4><div class="p">Conversion tables are stored in <samp class="codeph">/opt/ibm/iSeriesAccess/conv_tables</samp> and
|
||
|
use the following naming convention: <pre><4 byte hex number of FROM CCSID><4 byte hex number of TO CCSID>.tbl </pre>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="section"><p>For example, the conversation table for 819 to 500 is <samp class="codeph">033301f4.tbl</samp>.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>Many conversion tables are shipped with the iSeries Access
|
||
|
ODBC Driver. Additional conversion tables are downloaded from the server when
|
||
|
they are needed. You can also download conversion tables using the <samp class="codeph">CWBNLTBL</samp> utility. </p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">ODBC Application Character Set</h4><p>The ODBC application
|
||
|
character set is defined by the current locale's character set. To find out
|
||
|
the current locale, use the following command:</p>
|
||
|
<pre>locale</pre>
|
||
|
</div>
|
||
|
<div class="section"><p>To find out the current mapping between the current locale's character
|
||
|
set and the CCSID that is used, use the following command:</p>
|
||
|
<pre>/opt/ibm/iSeriesAccess/bin/cwbnltbl</pre>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Overriding the Character Set CCSID Mappings</h4><p>To change
|
||
|
or the add character set CCSID mapping, add the following lines to the $HOME/.iSeriesAccess/cwb_userprefs.ini
|
||
|
configuration file.</p>
|
||
|
</div>
|
||
|
<div class="section"><p>[CWB_CURRUSER\Software\IBM\Client Access Express\CurrentVersion\NLS]
|
||
|
CCSID-CODESET=attr_str:939,IBM939,819,IBM819</p>
|
||
|
</div>
|
||
|
<div class="section"><p>The above example creates mappings for CCSID 939 to character
|
||
|
set "IBM939" and for CCSID 819 to character set "IBM819". </p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">List of Available Locales</h4><p>To list the available
|
||
|
locales, use the following command:</p>
|
||
|
<pre>locale -a</pre>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">List of Available Iconv Character Sets</h4><p>To list the
|
||
|
available <samp class="codeph">iconv</samp> character sets, use the following command:
|
||
|
</p>
|
||
|
<pre> iconv -l</pre>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">How to Investigate Conversion Problems</h4><div class="p">Most conversion
|
||
|
problems are logged in the History Log. To turn on history logging, use the
|
||
|
following command: <pre>/opt/ibm/iSeriesAccess/bin/cwbtrc /hl:1</pre>
|
||
|
|
||
|
(Refer to CWBTRC for more about the trace utility.) </div>
|
||
|
</div>
|
||
|
<div class="section"><p>The history log output is in <samp class="codeph">$HOME/.iSeriesAccess/cwbhistory-<application
|
||
|
name-"$HOME/.iSeriesAccess/cwbhistory".csv</samp>. Use either a text editor
|
||
|
or a spread sheet to view the contents of the history log. </p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzatvodbc.htm" title="For information on using Open Database Connectivity (ODBC) with iSeries Access for Linux, see the following topics.">Open Database Connectivity</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|