ibm-information-center/dist/eclipse/plugins/i5OS.ic.db2_5.4.0.1/rbafzmstgntpp.htm

213 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 xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="dc.language" scheme="rfc1766" 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. -->
<meta name="dc.date" scheme="iso8601" content="2005-09-19" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<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="keywords" content="GRANT (Package Privileges) statement,
GRANT (Package Privileges), SQL statements, ALL clause, ALL PRIVILEGES clause,
ALTER clause, EXECUTE clause, ON PACKAGE clause,
in GRANT (Package Privileges) statement, authorization-name, PUBLIC clause,
WITH GRANT OPTION clause" />
<title>GRANT (Package Privileges)</title>
<link rel="stylesheet" type="text/css" href="ibmidwb.css" />
<link rel="stylesheet" type="text/css" href="ic.css" />
</head>
<body>
<a id="Top_Of_Page" name="Top_Of_Page"></a><!-- Java sync-link -->
<script language = "Javascript" src = "../rzahg/synch.js" type="text/javascript"></script>
<a name="gntpp"></a>
<h2 id="gntpp"><a href="rbafzmst02.htm#ToC_1119">GRANT (Package Privileges)</a></h2><a id="idx2803" name="idx2803"></a><a id="idx2804" name="idx2804"></a>
<a name="grntpp"></a>
<p id="grntpp">This form of the GRANT statement grants privileges on a package.</p>
<a name="wq1577"></a>
<h3 id="wq1577"><a href="rbafzmst02.htm#ToC_1120">Invocation</a></h3>
<p>This statement can be embedded in an application program or issued interactively.
It is an executable statement that can be dynamically prepared.</p>
<a name="wq1578"></a>
<h3 id="wq1578"><a href="rbafzmst02.htm#ToC_1121">Authorization</a></h3>
<p>The privileges held by the authorization ID of the statement must include
at least one of the following: </p>
<ul>
<li>For each package identified in the statement:
<ul>
<li>Every privilege specified in the statement</li>
<li>The system authority of *OBJMGT on the package</li>
<li>The system authority *EXECUTE on the library containing the package</li></ul></li>
<li>Administrative authority</li></ul>
<p>If WITH GRANT OPTION is specified, the privileges held by the authorization
ID of the statement must include at least one of the following: </p>
<ul>
<li>Ownership of the package</li>
<li>Administrative authority</li></ul>
<a name="wq1579"></a>
<h3 id="wq1579"><a href="rbafzmst02.htm#ToC_1122">Syntax</a></h3>
<a href="rbafzmstgntpp.htm#synsgrantp"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
<p>&nbsp;</p>
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn352.htm"
border="0" /></span><a href="#skipsyn-351"><img src="c.gif" alt="Skip visual syntax diagram"
border="0" /></a> .-PRIVILEGES-.
>>-GRANT--+-ALL--+------------+-+------------------------------->
| .-,-----------. |
| V | |
'---+-ALTER---+-+-----'
'-EXECUTE-'
.-,------------.
V |
>--ON PACKAGE----<span class="italic">package-name</span>-+--------------------------------->
.-,----------------------.
V |
>--TO----+-<span class="italic">authorization-name</span>-+-+--+-------------------+------->&lt;
'-PUBLIC-------------' '-WITH GRANT OPTION-'
</pre>
<a name="skipsyn-351" id="skipsyn-351"></a>
<a name="synsgrantp"></a>
<h3 id="synsgrantp"><a href="rbafzmst02.htm#ToC_1123">Description</a></h3>
<dl class="parml">
<dt class="bold">ALL <span class="base">or</span> ALL PRIVILEGES</dt><a id="idx2805" name="idx2805"></a><a id="idx2806" name="idx2806"></a>
<dd>Grants one or more privileges. The privileges granted are all those
grantable privileges that the authorization ID of the statement has on the
specified packages. Note that granting ALL PRIVILEGES on a package is not
the same as granting the system authority of *ALL.
<p>If you do not use ALL,
you must use one or more of the keywords listed below. Each keyword grants
the privilege described.</p>
</dd>
<dt class="bold">ALTER </dt><a id="idx2807" name="idx2807"></a>
<dd>Grants the privilege to use the COMMENT and LABEL statements.
</dd>
<dt class="bold">EXECUTE </dt><a id="idx2808" name="idx2808"></a>
<dd>Grants the privilege to execute statements in a package.
</dd>
<dt class="bold">ON PACKAGE <var class="pv">package-name</var> </dt><a id="idx2809" name="idx2809"></a>
<dd>Identifies the packages on which you are granting the privilege. The <span class="italic">package-name</span> must identify a package that exists at the
current server.
</dd>
<dt class="bold">TO</dt>
<dd>Indicates to whom the privileges are granted.
<dl class="parml">
<dt class="bold"><var class="pv">authorization-name,...</var> </dt><a id="idx2810" name="idx2810"></a>
<dd>Lists one or more authorization IDs.
</dd>
<dt class="bold">PUBLIC </dt><a id="idx2811" name="idx2811"></a>
<dd>Grants the privileges to a set of users (authorization IDs). For more
information, see <a href="rbafzmstauthown.htm#authown">Authorization, privileges and object ownership</a>.
</dd>
</dl>
</dd>
<dt class="bold">WITH GRANT OPTION </dt><a id="idx2812" name="idx2812"></a>
<dd>Allows the specified <span class="italic">authorization-names</span> to
grant privileges on the packages specified in the ON clause to other users.
<p>If WITH GRANT OPTION is omitted, the specified <span class="italic">authorization-names</span> cannot grant privileges on the packages specified in the ON clause to
another user unless they have received that authority from some other source
(for example, from a grant of the system authority *OBJMGT).</p>
</dd>
</dl>
<a name="wq1580"></a>
<h3 id="wq1580"><a href="rbafzmst02.htm#ToC_1124">Note</a></h3>
<p><span class="bold">Corresponding System Authorities:</span> GRANT and REVOKE
statements assign and remove system authorities for SQL objects. The following
table describes the system authorities that correspond to the SQL privileges:</p>
<a name="wq1581"></a>
<table id="wq1581" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 66. Privileges Granted to or Revoked from Packages</caption>
<thead valign="bottom">
<tr>
<th id="wq1582" width="50%" align="left" valign="bottom">SQL Privilege</th>
<th id="wq1583" width="50%" align="left" valign="bottom">Corresponding System Authorities when
Granting to or Revoking from a Package</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left" valign="top" headers="wq1582">ALL (Grant or revoke of ALL grants or revokes
only those privileges the authorization ID of the statement has)</td>
<td align="left" valign="top" headers="wq1583">
<div class="lines">*OBJALTER<br />
*OBJOPR<br />
*EXECUTE<br />
*OBJMGT (Revoke only)<br />
</div></td>
</tr>
<tr>
<td align="left" valign="top" headers="wq1582">ALTER</td>
<td align="left" valign="top" headers="wq1583">*OBJALTER</td>
</tr>
<tr>
<td align="left" valign="top" headers="wq1582">EXECUTE</td>
<td align="left" valign="top" headers="wq1583">
<div class="lines">*EXECUTE<br />
*OBJOPR<br />
</div></td>
</tr>
<tr>
<td align="left" valign="top" headers="wq1582">WITH GRANT OPTION</td>
<td align="left" valign="top" headers="wq1583">*OBJMGT</td>
</tr>
</tbody>
</table>
<a name="eqtablep"></a>
<p id="eqtablep"><span class="bold">Corresponding System Authorities When Checking Privileges to
a Package:</span> The following table describes the system authorities that
correspond to the SQL privileges when checking privileges to a package. The
left column lists the SQL privilege. The right column lists the equivalent
system authorities.</p>
<a name="wq1584"></a>
<table id="wq1584" width="100%" summary="" border="1" frame="border" rules="all">
<caption>Table 67. Corresponding System Authorities When Checking Privileges to a Package</caption>
<thead valign="bottom">
<tr>
<th id="wq1585" width="50%" align="left" valign="bottom">SQL Privilege</th>
<th id="wq1586" width="50%" align="left" valign="bottom">Corresponding System Authorities When
Checking Privileges to a Package</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left" valign="top" headers="wq1585">ALTER</td>
<td align="left" valign="top" headers="wq1586">*OBJALTER</td>
</tr>
<tr>
<td align="left" valign="top" headers="wq1585">EXECUTE</td>
<td align="left" valign="top" headers="wq1586">
<div class="lines">*EXECUTE and *OBJOPR<br />
</div></td>
</tr>
</tbody>
</table>
<p><span class="bold">Syntax alternatives:</span> The following keywords are synonyms
supported for compatibility to prior releases. These keywords are non-standard
and should not be used:</p>
<ul>
<li>The keyword RUN can be used as a synonym for EXECUTE.</li>
<li>The keyword PROGRAM can be used as a synonym for PACKAGE.</li></ul>
<a name="wq1587"></a>
<h3 id="wq1587"><a href="rbafzmst02.htm#ToC_1125">Example</a></h3>
<p>Grant the EXECUTE privilege on package PKGA to PUBLIC. </p>
<a name="grantx"></a>
<pre id="grantx" class="xmp"><span class="bold">GRANT EXECUTE</span>
<span class="bold">ON PACKAGE</span> PKGA
<span class="bold">TO PUBLIC</span></pre><a id="idx2813" name="idx2813"></a><a id="idx2814" name="idx2814"></a>
<hr /><br />
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstgntprc.htm">Previous Page</a> | <a href="rbafzmstgntseqp.htm">Next Page</a> | <a href="rbafzmst02.htm#wq1">Contents</a> |
<a href="rbafzmstindex.htm#index">Index</a> ]
<a id="Bot_Of_Page" name="Bot_Of_Page"></a>
</body>
</html>