ibm-information-center/dist/eclipse/plugins/i5OS.ic.cli_5.4.0.1/rzadpstartingservermode.htm

65 lines
3.4 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?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="Start DB2 UDB CLI in SQL server mode" />
<meta name="DC.subject" content="server mode, starting" />
<meta name="keywords" content="server mode, starting" />
<meta name="DC.Relation" scheme="URI" content="rzadpsqlapd.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzadpstartingservermode" />
<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>Start DB2 UDB
CLI in SQL server mode</title>
</head>
<body id="rzadpstartingservermode"><a name="rzadpstartingservermode"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Start DB2<sup>®</sup> UDB
CLI in SQL server mode</h1>
<div><div class="p">There are two ways to place a job into SQL server mode: <ol><li>The
most likely case is using the CLI function, <em>SQLSetEnvAttr</em>. The SQL
server mode is best suited to CLI applications because they already use the
concept of multiple connections handles. Set this mode immediately after allocating
the CLI environment. Furthermore, the job must not have run any SQL, or started
commitment control, before setting this mode. If either one of those cases
is true, the mode does not become changed to server mode, and SQL continues
to run "inline". <p>EXAMPLE.<br />
.<br />
SQLAllocEnv(&amp;henv);<br />
long attr;<br />
attr = SQL_TRUE<br />
SQLSetEnvAttr(henv,SQL_ATTR_SERVER_MODE,&amp;attr,0);<br />
SQLAllocConnect(henv,&amp;hdbc);<br />
.<br />
.</p>
</li>
<li>The second way to set server mode is using the Change Job (QWTCHGJB) API.
Refer to the <a href="../apiref/api.htm">APIs</a> topic
in the information center for a complete description of the QWTCHGJB API.</li>
</ol>
</div>
<p>As soon as SQL server mode has been set, all SQL connections and SQL statements
run in server mode. There is no switching back and forth. The job, once in
server mode, cannot start commitment control, and cannot use Interactive SQL.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzadpsqlapd.htm" title="This topic is about why and how you should run your DB2 UDB CLI applications in server mode.">Run DB2 UDB CLI in server mode</a></div>
</div>
</div>
</body>
</html>