ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzalf_5.4.0.1/rzalfdatabase.htm

144 lines
9.3 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="Database" />
<meta name="abstract" content="i5/OS PASE supports the DB2 UDB for iSeries Call Level Interface (CLI). DB2 CLI on AIX and i5/OS are not proper subsets of each other, so there are minor differences in a few interfaces, and some APIs in one implementation might not exist in another." />
<meta name="description" content="i5/OS PASE supports the DB2 UDB for iSeries Call Level Interface (CLI). DB2 CLI on AIX and i5/OS are not proper subsets of each other, so there are minor differences in a few interfaces, and some APIs in one implementation might not exist in another." />
<meta name="DC.Relation" scheme="URI" content="rzalfinteract.htm" />
<meta name="DC.Relation" scheme="URI" content="rzalfdatabaseexamp.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/qp2term.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/qp2shell.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/pase__setccsid.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/pase_sqloverrideccsid400.htm" />
<meta name="DC.Relation" scheme="URI" content="rzalfheaders.htm" />
<meta name="DC.Relation" scheme="URI" content="rzalfexports.htm" />
<meta name="DC.Relation" scheme="URI" content="../cli/rzadpkickoff.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2000, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2000, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzalfdatabase" />
<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>Database</title>
</head>
<body id="rzalfdatabase"><a name="rzalfdatabase"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Database</h1>
<div><p><span class="keyword">i5/OS™</span> PASE supports
the DB2<sup>®</sup> UDB
for iSeries™ Call
Level Interface (CLI). DB2 CLI on AIX<sup>®</sup> and <span class="keyword">i5/OS</span> are
not proper subsets of each other, so there are minor differences in a few
interfaces, and some APIs in one implementation might not exist in another.</p>
<p> Because of this, you should consider the following points:</p>
<ul><li>Code can be generated, but not tested, on AIX itself. Instead, you must test your
code across platforms within <span class="keyword">i5/OS</span> PASE.</li>
<li>You must compile with the <span class="keyword">i5/OS</span> version
of header file <tt>sqlcli.h</tt>. A program compiled using the AIX version of
this header file will not run in <span class="keyword">i5/OS</span> PASE.</li>
</ul>
<p><span class="keyword">i5/OS</span> is an EBCDIC encoded
system by default, while AIX is based on ASCII. This difference often requires
data conversions between the <span class="keyword">i5/OS</span> database
(DB2 UDB
for iSeries)
and the <span class="keyword">i5/OS</span> PASE application.</p>
<p>In the <span class="keyword">i5/OS</span> PASE implementation
of the DB2 CLI, <span class="keyword">i5/OS</span> PASE system-provided library
routines automatically perform data conversions from ASCII to Extended Binary
Coded Decimal Interchange Code (EBCDIC) and back for character data. The conversions
are made based on the tagged CCSID of the data being accessed and the ASCII
CCSID under which the <span class="keyword">i5/OS</span> PASE
program is running. If the database is tagged, or if it is tagged with a CCSID
of 65535, no automatic conversion takes place. It is left to the application
to understand the encoding format of the data and to do any necessary conversion.</p>
<div class="section"><h4 class="sectiontitle">Work with CCSIDs</h4><p>When you use
the Qp2RunPase() API, you must explicitly specify the <span class="keyword">i5/OS</span> PASE
CCSID.</p>
<p>You can control the <span class="keyword">i5/OS</span> PASE
CCSID by setting both of these variables in the ILE before you call API program
QP2TERM, QP2SHELL, or QP2SHELL2:</p>
<ul><li>PASE_LANG</li>
<li>QIBM_PASE_CCSID</li>
</ul>
<p>If the ILE omits either or both of these variables, QP2TERM, QP2SHELL,
and QP2SHELL2 by default set the <span class="keyword">i5/OS</span> PASE
CCSID and <span class="keyword">i5/OS</span> PASE environment
variable <tt>LANG</tt> with the best <span class="keyword">i5/OS</span> PASE
equivalents of the language and CCSID attributes of your job.</p>
<p>Extensions
to libc.a give the <span class="keyword">i5/OS</span> PASE
application the ability to change the running CCSID of the application, using
the <span class="apiname">_SETCCSID()</span> function.</p>
<p>Another
extension gives the <span class="keyword">i5/OS</span> PASE
application the ability to override the DB2 CLI internal conversion without changing
the CCSID of the application. The <span class="apiname">SQLOverrideCCSID400()</span> function
accepts an integer of the override CCSID as a single parameter.</p>
<div class="note"><span class="notetitle">Note:</span> The
CCSID override function <span class="apiname">SQLOverrideCCSID400()</span> must be called
before any other SQLx() API for the override to take effect; otherwise, the
request is ignored.</div>
</div>
<div class="section"><h4 class="sectiontitle">Use the DB2 UDB for iSeries CLI in <span class="keyword">i5/OS</span> PASE
programs</h4><p>To use DB2 CLI in your <span class="keyword">i5/OS</span> PASE
programs, you need to copy the sqlcli.h header file and the libdb400.exp export
file to your AIX system
before you compile your source. The DB2 CLI library routines are in <tt>libdb400.a</tt> for
the <span class="keyword">i5/OS</span> PASE environment,
and are implemented using pthread interfaces, providing thread safety. Most <span class="keyword">i5/OS</span> PASE CLI functions call corresponding
ILE CLI functions to perform the required operation.</p>
<div class="note"><span class="notetitle">Note:</span> When
you use the DB2 CLIs
in your <span class="keyword">i5/OS</span> PASE programs,
consider the following points:<ul><li>SQLGetSubString always returns an EBCDIC string when sub-stringing the
CLOB/DBCLOB field. The SQLGetSubString is used only for LOB data types.</li>
<li>SQLTables, column 4 of the result set (table type), is always returned
as EBCDIC.</li>
<li>To render graphic-typed data in an <span class="keyword">i5/OS</span> PASE
program, the data must be typed in the program as <tt>wchar</tt>; this causes
the database to convert from a graphic and pure double-byte character to Unicode/UCS-2.
Otherwise, the database converts between the CCSID of the data and the CCSID
of the <span class="keyword">i5/OS</span> job. The database
does not support conversion between EBCDIC graphic and the CCSID (either from
the Qp2RunPase() API or the SQLOverrideCCSID400() API).</li>
</ul>
</div>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzalfdatabaseexamp.htm">Example: Call DB2 UDB for iSeries CLI functions in an i5/OS PASE program</a></strong><br />
The example in this topic shows an <span class="keyword">i5/OS</span> PASE
program that accesses DB2 UDB for iSeries using the DB2 UDB for iSeries SQL call level interfaces.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzalfinteract.htm" title="As you customize your i5/OS PASE programs to use i5/OS functions, you need to consider the ways in which your program will interact with them.">How i5/OS PASE programs interact with i5/OS</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="rzalfheaders.htm" title="You can follow the instructions in this topic to copy header files from your iSeries server to an AIX machine.">Copy header files</a></div>
<div><a href="rzalfexports.htm" title="You can follow the instructions in this topic to copy the export files from your iSeries server to an AIX directory.">Copy export files</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../apis/qp2term.htm">QP2TERM()--Run an i5/OS PASE Terminal Session</a></div>
<div><a href="../apis/qp2shell.htm">QP2SHELL() and QP2SHELL2()--Run an i5/OS PASE Shell Program</a></div>
<div><a href="../apis/pase__setccsid.htm">_SETCCSID()--Set i5/OS PASE CCSID</a></div>
<div><a href="../apis/pase_sqloverrideccsid400.htm">SQLOverrideCCSID400()--Override SQL CLI CCSID for i5/OS PASE</a></div>
<div><a href="../cli/rzadpkickoff.htm">SQL call level interface</a></div>
</div>
</div>
</body>
</html>