ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaik_5.4.0.1/rzaiksqlconsider.htm

61 lines
3.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="reference" />
<meta name="DC.Title" content="SQL Statement Considerations" />
<meta name="abstract" content="Identify SQL statement functions that are accomplished using ODBC." />
<meta name="description" content="Identify SQL statement functions that are accomplished using ODBC." />
<meta name="DC.Relation" scheme="URI" content="odbcapis.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="rzaiksqlconsider" />
<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 Statement Considerations</title>
</head>
<body id="rzaiksqlconsider"><a name="rzaiksqlconsider"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQL Statement Considerations</h1>
<div><p>Identify SQL statement functions that are accomplished using ODBC.</p>
<div class="section"><p>There are several SQL statements that are not recommended
to be prepared and executed. Examples of these are:</p>
<ul><li>SET™ TRANSACTION</li>
<li>SET SCHEMA</li>
<li>SET PATH</li>
<li>COMMIT</li>
<li>ROLLBACK</li>
<li>CONNECT TO</li>
<li>DISCONNECT ALL</li>
</ul>
<p>For these statements, you can accomplish the same behavior in other
ways through ODBC. For example, if you turn off autocommit for the ODBC connection,
you can use the SQLEndTran option instead of attempting to execute a COMMIT
or ROLLBACK statement.</p>
<p>Note that the SET SESSION AUTHORIZATION SQL statement changes
the user that is in control of that connection which leads to unpredictable
behavior when used in combination with ODBC connection pooling. The recommended
way to use the SET SESSION AUTHORIZATION statement, through
ODBC, is to free all open statement handles except for the SET SESSION
AUTHORIZATION on which is it to run. Once SET SESSION AUTHORIZATION is run, you should
free the statement handle. </p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="odbcapis.htm" title="The following table lists ODBC 3.x APIs by their associated task and identifies considerations for each API.">ODBC 3.x APIs Notes</a></div>
</div>
</div>
</body>
</html>