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

117 lines
6.8 KiB
HTML
Raw 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="reference" />
<meta name="DC.Title" content="SQLGetEnvAttr - Return current setting of an environment Attribute" />
<meta name="DC.Relation" scheme="URI" content="rzadphdapi.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="rzadpfngenva" />
<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>SQLGetEnvAttr</title>
</head>
<body id="rzadpfngenva"><a name="rzadpfngenva"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">SQLGetEnvAttr - Return current setting of an environment
Attribute</h1>
<div><div class="section"></div>
<div class="section"><h4 class="sectiontitle">Purpose</h4> <p><samp class="codeph">SQLGetEnvAttr()</samp> returns
the current settings for the specified environment attribute.</p>
<p>These
options are set using the <samp class="codeph">SQLSetEnvAttr()</samp> function.</p>
</div>
<div class="section"><h4 class="sectiontitle">Syntax</h4><pre>SQLRETURN SQLGetEnvAttr (SQLHENV henv,
SQLINTEGER Attribute,
SQLPOINTER Value,
SQLINTEGER BufferLength,
SQLINTEGER *StringLength);</pre>
</div>
<div class="section"><h4 class="sectiontitle">Function arguments</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="all"><caption>Table 1. SQLGetEnvAttr arguments</caption><thead align="left"><tr><th align="left" valign="top" width="20%" id="d0e53">Data type</th>
<th align="left" valign="top" width="20%" id="d0e55">Argument</th>
<th align="left" valign="top" width="20%" id="d0e57">Use</th>
<th align="left" valign="top" width="40%" id="d0e59">Description</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="20%" headers="d0e53 ">SQLHENV</td>
<td align="left" valign="top" width="20%" headers="d0e55 "><em>henv</em></td>
<td align="left" valign="top" width="20%" headers="d0e57 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e59 ">Environment handle.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e53 ">SQLINTEGER *</td>
<td align="left" valign="top" width="20%" headers="d0e55 "><em>StringLength</em></td>
<td align="left" valign="top" width="20%" headers="d0e57 ">Output</td>
<td align="left" valign="top" width="40%" headers="d0e59 ">Length in bytes of the output data if the
attribute value is a character string; otherwise, unused.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e53 ">SQLINTEGER</td>
<td align="left" valign="top" width="20%" headers="d0e55 "><em>Attribute</em></td>
<td align="left" valign="top" width="20%" headers="d0e57 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e59 ">Attribute to retrieve. Refer to <a href="rzadpfnsenva.htm#rzadpfnsenva__tbenva">Table 2</a> for
more information.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e53 ">SQLINTEGER</td>
<td align="left" valign="top" width="20%" headers="d0e55 "><em>BufferLength</em></td>
<td align="left" valign="top" width="20%" headers="d0e57 ">Input</td>
<td align="left" valign="top" width="40%" headers="d0e59 ">Maximum size of buffer pointed to by <em>Value</em>,
if the attribute value is a character string; otherwise, unused.</td>
</tr>
<tr><td align="left" valign="top" width="20%" headers="d0e53 ">SQLPOINTER</td>
<td align="left" valign="top" width="20%" headers="d0e55 "><em>Value</em></td>
<td align="left" valign="top" width="20%" headers="d0e57 ">Output</td>
<td align="left" valign="top" width="40%" headers="d0e59 ">Current value associated with <em>Attribute</em>.
The type of the value returned depends on <em>Attribute</em>.</td>
</tr>
</tbody>
</table>
</div>
<p>If <em>Attribute</em> does not denote a string, then DB2<sup>®</sup> UDB CLI ignores <em>BufferLength</em> and
does not set <em>StringLength</em>.</p>
</div>
<div class="section"><h4 class="sectiontitle">Usage</h4><p><samp class="codeph">SQLGetEnvAttr()</samp> can be called
at any time between the allocation and freeing of the environment handle.
It obtains the current value of the environment attribute.</p>
</div>
<div class="section"><h4 class="sectiontitle">Diagnostics</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="hsides" border="1" rules="rows"><caption>Table 2. SQLGetEnvAttr SQLSTATEs</caption><thead align="left"><tr><th align="left" valign="top" width="25%" id="d0e159">SQLSTATE</th>
<th align="left" valign="top" width="25%" id="d0e161">Description</th>
<th align="left" valign="top" width="50%" id="d0e163">Explanation</th>
</tr>
</thead>
<tbody><tr><td align="left" valign="top" width="25%" headers="d0e159 "><strong>HY</strong>001</td>
<td align="left" valign="top" width="25%" headers="d0e161 ">Memory allocation failure</td>
<td align="left" valign="top" width="50%" headers="d0e163 ">The driver is unable to allocate memory required
to support the processing or completion of the function.</td>
</tr>
<tr><td align="left" valign="top" width="25%" headers="d0e159 "><strong>HY</strong>009</td>
<td align="left" valign="top" width="25%" headers="d0e161 ">Attribute out of range</td>
<td align="left" valign="top" width="50%" headers="d0e163 ">An <em>Attribute</em> value that is not valid
is specified. <p>The argument <em>Value</em> or <em>StringLength</em> is a null
pointer.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzadphdapi.htm" title="This topic provides a description of each CLI function.">DB2 UDB CLI functions</a></div>
</div>
</div>
</body>
</html>