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

169 lines
10 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="Access remote databases with interactive SQL" />
<meta name="abstract" content="In interactive SQL, you can communicate with a remote relational database by using the SQL CONNECT statement. Interactive SQL uses the CONNECT (Type 2) semantics (distributed unit of work) for CONNECT statements." />
<meta name="description" content="In interactive SQL, you can communicate with a remote relational database by using the SQL CONNECT statement. Interactive SQL uses the CONNECT (Type 2) semantics (distributed unit of work) for CONNECT statements." />
<meta name="DC.subject" content="session services, accessing remote databases, remote databases, accessing from interactive SQL, interactive SQL, distributed relational database, interactive SQL, session attributes, CONNECT statement, package" />
<meta name="keywords" content="session services, accessing remote databases, remote databases, accessing from interactive SQL, interactive SQL, distributed relational database, interactive SQL, session attributes, CONNECT statement, package" />
<meta name="DC.Relation" scheme="URI" content="rbafyintract.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafydetconn.htm" />
<meta name="DC.Relation" scheme="URI" content="../ddp/rbal1kickoff.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="rbafyaccrdi" />
<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>Access remote databases with interactive SQL</title>
</head>
<body id="rbafyaccrdi"><a name="rbafyaccrdi"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Access remote databases with interactive SQL</h1>
<div><p>In interactive SQL, you can communicate with a remote relational
database by using the SQL CONNECT statement. Interactive SQL uses the CONNECT
(Type 2) semantics (distributed unit of work) for CONNECT statements.</p>
<div class="section"><p>Interactive SQL does an implicit connect to the local RDB when
starting an SQL session. When the CONNECT statement is completed, a message
shows the relational database connection that was established. If starting
a new session and COMMIT(*NONE) was not specified, or if restoring a saved
session and the commit level saved with the session was not *NONE, the connection
will be registered with commitment control. This implicit connect and possible
commitment control registration may influence subsequent connections to remote
databases. It is recommended that prior to connecting to the remote system:</p>
<ul><li>When connecting to an application server that does not support distributed
unit of work, a RELEASE ALL followed by a COMMIT be issued to end previous
connections, including the implicit connection to local.</li>
<li>When connecting to a non-<span class="keyword">DB2<sup>®</sup> UDB for iSeries™</span> application
server, a RELEASE ALL followed by a COMMIT be issued to end previous connections,
including the implicit connection to local, and change the commitment control
level to at least *CHG.</li>
</ul>
</div>
<div class="section"><p>When you are connecting to a non-<span class="keyword">DB2 UDB for iSeries</span> application
server, some session attributes are changed to attributes that are supported
by that application server. The following table shows the attributes that
change.</p>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="all"><caption>Table 1. Values table</caption><thead align="left"><tr><th align="left" valign="bottom" width="33.33333333333333%" id="d0e84">Session attribute</th>
<th align="left" valign="bottom" width="33.33333333333333%" id="d0e86">Original value</th>
<th align="left" valign="bottom" width="33.33333333333333%" id="d0e88">New value</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Date Format</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 "> <p>*YMD<br />
</p>
<p>*DMY<br />
</p>
<p>*MDY</p>
<p>*JUL</p>
</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 "> <p>*ISO </p>
<p>*EUR </p>
<p>*USA </p>
<p>*USA</p>
</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Time Format</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 ">*HMS with a : separator *HMS with any other
separator</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 "> <p>*JIS</p>
<p>*EUR</p>
</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Commitment Control</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 "> <p>*CHG, </p>
<p>*NONE </p>
<p>*ALL</p>
</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 ">*CS Repeatable Read</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Naming Convention</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 ">*SYS</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 ">*SQL</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Allow Copy Data</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 ">*NO, *YES</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 ">*OPTIMIZE</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Data Refresh</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 ">*ALWAYS</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 ">*FORWARD</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Decimal Point</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 ">*SYSVAL</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 ">*PERIOD</td>
</tr>
<tr><td align="left" valign="top" width="33.33333333333333%" headers="d0e84 ">Sort Sequence</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e86 ">Any value other than *HEX</td>
<td align="left" valign="top" width="33.33333333333333%" headers="d0e88 ">*HEX</td>
</tr>
</tbody>
</table>
</div>
<div class="section"> <div class="note"><span class="notetitle">Notes:</span> <ol><li>If connecting to an server that is running a release prior to Version
2 Release 3, the sort sequence value changes to *HEX.</li>
<li>When connecting to a DB2/2 or DB2/6000 application server, the date and
time formats specified must be the same format.</li>
</ol>
</div>
</div>
<div class="section"><p>After the connection is completed, a message is sent stating that
the session attributes have been changed. The changed session attributes can
be displayed by using the session services display. While interactive SQL
is running, no other connection can be established for the default activation
group.</p>
</div>
<div class="section"><p>When connected to a remote system with interactive SQL, a statement
processing mode of syntax-only checks the syntax of the statement against
the syntax supported by the local system instead of the remote system. Similarly,
the SQL prompter and list support use the statement syntax and naming conventions
supported by the local system. The statement is run, however, on the remote
system. Because of differences in the level of SQL support between the two
systems, syntax errors may be found in the statement on the remote system
at run time.</p>
</div>
<div class="section"><p>Lists of schemas and tables are available when you are connected
to the local relational database. Lists of columns are available only when
you are connected to a relational database manager that supports the DESCRIBE
TABLE statement.</p>
</div>
<div class="section"><p>When you exit interactive SQL with connections that have pending
changes or connections that use protected conversations, the connections remain.
If you do not perform additional work over the connections, the connections
are ended during the next COMMIT or ROLLBACK operation. You can also end the
connections by doing a RELEASE ALL and a COMMIT before exiting interactive
SQL.</p>
</div>
<div class="section"><p>Using interactive SQL for remote access to non-<span class="keyword">DB2 UDB for iSeries</span> application
servers can require some setup. </p>
</div>
<div class="section"> <div class="note"><span class="notetitle">Note:</span> In the output of a communications trace, there may be a reference
to a 'CREATE TABLE XXX' statement. This is used to determine package existence;
it is part of normal processing, and can be ignored.</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyintract.htm" title="Interactive SQL allows the programmer or database administrator to quickly and easily define, update, delete, or look at data for testing, problem analysis, and database maintenance.">Use interactive SQL</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="rbafydetconn.htm" title="When a remote connection is established it will use either an unprotected or protected network connection.">Determine connection type</a></div>
<div><a href="../ddp/rbal1kickoff.htm">Distributed database programming</a></div>
</div>
</div>
</body>
</html>