532 lines
25 KiB
HTML
532 lines
25 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 (Table or View Privileges) statement,
|
|
GRANT (Table or View Privileges), SQL statements, ALL PRIVILEGES clause,
|
|
SQL (Structured Query Language), ALTER clause, DELETE clause, INDEX clause,
|
|
INSERT clause, REFERENCES clause, SELECT clause, UPDATE clause, ON TABLE clause,
|
|
in GRANT (Table or View Privileges) statement, table-name, view-name,
|
|
authorization-name, PUBLIC clause, WITH GRANT OPTION clause" />
|
|
<title>GRANT (Table or View 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="gnt"></a>
|
|
<h2 id="gnt"><a href="rbafzmst02.htm#ToC_1133">GRANT (Table or View Privileges)</a></h2><a id="idx2827" name="idx2827"></a><a id="idx2828" name="idx2828"></a>
|
|
<a name="grnttbl"></a>
|
|
<p id="grnttbl">This form of the GRANT statement grants privileges on tables
|
|
or views.</p>
|
|
<a name="wq1599"></a>
|
|
<h3 id="wq1599"><a href="rbafzmst02.htm#ToC_1134">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="wq1600"></a>
|
|
<h3 id="wq1600"><a href="rbafzmst02.htm#ToC_1135">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 table or view identified in the statement:
|
|
<ul>
|
|
<li>Every privilege specified in the statement</li>
|
|
<li>The system authority of *OBJMGT on the table or view</li>
|
|
<li>The system authority *EXECUTE on the library containing the table or view</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 table</li>
|
|
<li>Administrative authority</li></ul>
|
|
<a name="wq1601"></a>
|
|
<h3 id="wq1601"><a href="rbafzmst02.htm#ToC_1136">Syntax</a></h3>
|
|
<a href="rbafzmstgnt.htm#synsgranttbl"><img src="c.gif" alt="Click to skip syntax diagram" /></a>
|
|
<pre class="cgraphic"><span><img src="c.gif" alt="Read syntax diagram" longdesc="rbafzmstsyn354.htm"
|
|
border="0" /></span><a href="#skipsyn-353"><img src="c.gif" alt="Skip visual syntax diagram"
|
|
border="0" /></a> .-PRIVILEGES-.
|
|
>>-GRANT--+-ALL--+------------+---------------------------+----->
|
|
| .-,-----------------------------------------. |
|
|
| V | |
|
|
'---+-ALTER---------------------------------+-+-'
|
|
+-DELETE--------------------------------+
|
|
+-INDEX---------------------------------+
|
|
+-INSERT--------------------------------+
|
|
+-REFERENCES--+-----------------------+-+
|
|
| | .-,-----------. | |
|
|
| | V | | |
|
|
| '-(----<span class="italic">column-name</span>-+--)-' |
|
|
+-SELECT--------------------------------+
|
|
'-UPDATE--+-----------------------+-----'
|
|
| .-,-----------. |
|
|
| V | |
|
|
'-(----<span class="italic">column-name</span>-+--)-'
|
|
|
|
.-,--------------.
|
|
.-TABLE-. V |
|
|
>--ON--+-------+----+-<span class="italic">table-name</span>-+-+---------------------------->
|
|
'-<span class="italic">view-name</span>--'
|
|
|
|
.-,----------------------.
|
|
V |
|
|
>--TO----+-<span class="italic">authorization-name</span>-+-+--+-------------------+-------><
|
|
'-PUBLIC-------------' '-WITH GRANT OPTION-'
|
|
|
|
</pre>
|
|
<a name="skipsyn-353" id="skipsyn-353"></a>
|
|
<a name="synsgranttbl"></a>
|
|
<h3 id="synsgranttbl"><a href="rbafzmst02.htm#ToC_1137">Description</a></h3>
|
|
<dl class="parml">
|
|
<dt class="bold">ALL <span class="base">or</span> ALL PRIVILEGES </dt><a id="idx2829" name="idx2829"></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 tables or views. Note that granting ALL PRIVILEGES on a table or
|
|
view is not the same as granting the system authority of *ALL. <a id="idx2830" name="idx2830"></a><a id="idx2831" name="idx2831"></a>
|
|
</dd>
|
|
<dt class="bold">ALTER </dt><a id="idx2832" name="idx2832"></a>
|
|
<dd>Grants the privilege to alter the specified table or create or drop
|
|
a trigger on the specified table. Grants the privilege to use the COMMENT
|
|
and LABEL statements on tables and views.
|
|
</dd>
|
|
<dt class="bold">DELETE </dt><a id="idx2833" name="idx2833"></a>
|
|
<dd>Grants the privilege to delete rows from the specified table or view.
|
|
If a view is specified, it must be a deletable view.
|
|
</dd>
|
|
<dt class="bold">INDEX </dt><a id="idx2834" name="idx2834"></a>
|
|
<dd>Grants the privilege to create an index on the specified table. This
|
|
privilege cannot be granted on a view.
|
|
</dd>
|
|
<dt class="bold">INSERT </dt><a id="idx2835" name="idx2835"></a>
|
|
<dd>Grants the privilege to insert rows into the specified table or view.
|
|
If a view is specified, it must be an insertable view.
|
|
</dd>
|
|
<dt class="bold">REFERENCES </dt><a id="idx2836" name="idx2836"></a>
|
|
<dd>Grants the privilege to add a referential constraint in which each specified
|
|
table is a parent. If a list of columns is not specified or if REFERENCES
|
|
is granted to all columns of the table or view via the specification of ALL
|
|
PRIVILEGES, the grantee(s) can add referential constraints using all columns
|
|
of each table specified in the ON clause as a parent key, even those added
|
|
later via the ALTER TABLE statement. This privilege can be granted on a view,
|
|
but the privilege is not used for a view.
|
|
</dd>
|
|
<dt class="bold">REFERENCES (<var class="pv">column-name</var>,...) </dt><a id="idx2837" name="idx2837"></a>
|
|
<dd>Grants the privilege to add a referential constraint in which each specified
|
|
table is a parent using only those columns specified in the column list as
|
|
a parent key. Each <var class="pv">column-name</var> must be an unqualified name that identifies
|
|
a column of each table specified in the ON clause. This privilege can be granted
|
|
on the columns of a view, but the privilege is not used for a view.
|
|
</dd>
|
|
<dt class="bold">SELECT </dt><a id="idx2838" name="idx2838"></a>
|
|
<dd>Grants the privilege to create a view or read data from the specified
|
|
table or view. For example, the SELECT privilege is required if a table or
|
|
view is specified in a query.
|
|
</dd>
|
|
<dt class="bold">UPDATE </dt><a id="idx2839" name="idx2839"></a>
|
|
<dd>Grants the privilege to update rows in the specified table or view.
|
|
If a list of columns is not specified or if UPDATE is granted to all columns
|
|
of the table or view via the specification of ALL PRIVILEGES, the grantee(s)
|
|
can update all updatable columns on each table specified in the ON clause,
|
|
even those added later via the ALTER TABLE statement. If a view is specified,
|
|
it must be an updatable view.
|
|
</dd>
|
|
<dt class="bold">UPDATE (<var class="pv">column-name</var>,...) </dt><a id="idx2840" name="idx2840"></a>
|
|
<dd>Grants the privilege to use the UPDATE statement to update only those
|
|
columns that are identified in the column list. Each <var class="pv">column-name</var> must
|
|
be an unqualified name that identifies a column of each table and view specified
|
|
in the ON clause. If a view is specified, it must be an updatable view and
|
|
the specified columns must be updatable columns.
|
|
</dd>
|
|
<dt class="bold">ON <var class="pv">table-name</var><span class="base"> or </span> <var class="pv">view-name,...</var> </dt><a id="idx2841" name="idx2841"></a><a id="idx2842" name="idx2842"></a><a id="idx2843" name="idx2843"></a>
|
|
<dd>Identifies the tables or views on which the privileges are granted.
|
|
The <var class="pv">table-name</var> or <var class="pv">view-name</var> must identify a table or view
|
|
that exists at the current server, but must not identify a global temporary
|
|
table.
|
|
</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="idx2844" name="idx2844"></a>
|
|
<dd>Lists one or more authorization IDs.
|
|
</dd>
|
|
<dt class="bold">PUBLIC </dt><a id="idx2845" name="idx2845"></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="idx2846" name="idx2846"></a>
|
|
<dd>Allows the specified <span class="italic">authorization-names</span> to
|
|
grant privileges on the tables and views 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 tables and views specified
|
|
in the ON clause 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="nominds"></a>
|
|
<h3 id="nominds"><a href="rbafzmst02.htm#ToC_1138">Notes</a></h3>
|
|
<p><span class="bold">Corresponding system authorities:</span> The 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
|
|
when granting to a table. The left column lists the SQL privilege. The right
|
|
column lists the equivalent system authorities that are granted or revoked.</p>
|
|
<a name="wq1602"></a>
|
|
<table id="wq1602" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 70. Privileges Granted to or Revoked from Tables</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1603" width="50%" align="left" valign="bottom">SQL Privilege</th>
|
|
<th id="wq1604" width="50%" align="left" valign="bottom">Corresponding System Authorities when
|
|
Granting to or Revoking from a Table</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">ALL (GRANT or revoke of ALL only grants or
|
|
revokes those privileges the authorization ID of the statement has)</td>
|
|
<td align="left" valign="top" headers="wq1604">
|
|
<div class="lines">*OBJALTER <sup class="fn"><a href="rbafzmstgnt.htm#objaltr">72</a></sup><br />
|
|
*OBJMGT (Revoke only)<br />
|
|
*OBJOPR<br />
|
|
*OBJREF<br />
|
|
*ADD<br />
|
|
*DLT<br />
|
|
*READ<br />
|
|
*UPD<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">ALTER</td>
|
|
<td align="left" valign="top" headers="wq1604">*OBJALTER <sup class="fn"><a href="rbafzmstgnt.htm#withhld">73</a></sup></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">DELETE</td>
|
|
<td align="left" valign="top" headers="wq1604">
|
|
<div class="lines">*OBJOPR<br />
|
|
*DLT<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">INDEX</td>
|
|
<td align="left" valign="top" headers="wq1604">*OBJALTER <sup class="fn"><a href="rbafzmstgnt.htm#withhld">73</a></sup></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">INSERT</td>
|
|
<td align="left" valign="top" headers="wq1604">
|
|
<div class="lines">*OBJOPR<br />
|
|
*ADD<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">REFERENCES</td>
|
|
<td align="left" valign="top" headers="wq1604">*OBJREF <sup class="fn"><a href="rbafzmstgnt.htm#withhld">73</a></sup></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">SELECT</td>
|
|
<td align="left" valign="top" headers="wq1604">
|
|
<div class="lines">*OBJOPR<br />
|
|
*READ<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">UPDATE</td>
|
|
<td align="left" valign="top" headers="wq1604">
|
|
<div class="lines">*OBJOPR<br />
|
|
*UPD<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1603">WITH GRANT OPTION</td>
|
|
<td align="left" valign="top" headers="wq1604">*OBJMGT</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>The following table describes the system authorities that correspond to
|
|
the SQL privileges when granting to a view. The left column lists the SQL
|
|
privilege. The middle column lists the equivalent system authorities that
|
|
are granted to or revoked from the view itself. The right column lists the
|
|
system authorities that are granted to all tables and views referenced in
|
|
the view's definition, and if a view is referenced, all tables and views referenced
|
|
in its definition, and so on. <sup class="fn"><a href="rbafzmstgnt.htm#fn20">74</a></sup> </p>
|
|
<p>If a view references more than one table or view, the *DLT,
|
|
*ADD, and *UPD system authorities are only granted to the first table or view
|
|
in the fullselect of the view definition. The *READ system authority is granted
|
|
to all tables and views referenced in the view definition.</p>
|
|
<p>If more than one system authority will be granted with an SQL privilege,
|
|
and any one of the authorities cannot be granted, then a warning occurs and
|
|
no authorities will be granted for that privilege. Unlike GRANT, REVOKE only
|
|
revokes system authorities to the view. No system authorities are revoked
|
|
from the referenced tables and views.</p>
|
|
<a name="pvw"></a>
|
|
<table id="pvw" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 71. Privileges Granted to or Revoked from Views</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1605" width="33%" align="left" valign="bottom">SQL Privilege</th>
|
|
<th id="wq1606" width="33%" align="left" valign="bottom">Corresponding System Authorities Granted
|
|
to or Revoked from View</th>
|
|
<th id="wq1607" width="33%" align="left" valign="bottom">Corresponding System Authorities Granted
|
|
to or Revoked from Referenced Tables and Views</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">ALL (GRANT or REVOKE of ALL only grants or
|
|
revokes those privileges the authorization ID of the statement has)</td>
|
|
<td align="left" valign="top" headers="wq1606">
|
|
<div class="lines">*OBJALTER<br />
|
|
*OBJMGT (Revoke only)<br />
|
|
*OBJOPR<br />
|
|
*OBJREF<br />
|
|
*ADD<br />
|
|
*DLT<br />
|
|
*READ<br />
|
|
*UPD<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1607">
|
|
<div class="lines">*ADD<br />
|
|
*DLT<br />
|
|
*READ<br />
|
|
*UPD<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">ALTER</td>
|
|
<td align="left" valign="top" headers="wq1606">*OBJALTER <sup class="fn"><a href="rbafzmstgnt.htm#withhld">73</a></sup></td>
|
|
<td align="left" valign="top" headers="wq1607">None</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">DELETE</td>
|
|
<td align="left" valign="top" headers="wq1606">
|
|
<div class="lines">*OBJOPR<br />
|
|
*DLT<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1607">*DLT</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">INDEX</td>
|
|
<td align="left" valign="top" headers="wq1606">Not Applicable</td>
|
|
<td align="left" valign="top" headers="wq1607">Not Applicable</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">INSERT</td>
|
|
<td align="left" valign="top" headers="wq1606">
|
|
<div class="lines">*OBJOPR<br />
|
|
*ADD<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1607">*ADD</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">REFERENCES</td>
|
|
<td align="left" valign="top" headers="wq1606">*OBJREF <sup class="fn"><a href="rbafzmstgnt.htm#withhld">73</a></sup></td>
|
|
<td align="left" valign="top" headers="wq1607">None</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">SELECT</td>
|
|
<td align="left" valign="top" headers="wq1606">
|
|
<div class="lines">*OBJOPR<br />
|
|
*READ<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1607">*READ</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">UPDATE</td>
|
|
<td align="left" valign="top" headers="wq1606">
|
|
<div class="lines">*OBJOPR<br />
|
|
*UPD<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1607">*UPD</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1605">WITH GRANT OPTION</td>
|
|
<td align="left" valign="top" headers="wq1606">*OBJMGT</td>
|
|
<td align="left" valign="top" headers="wq1607">None</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="eqtablet"></a>
|
|
<p id="eqtablet"><span class="bold">Corresponding system authorities when checking privileges to
|
|
a table or view:</span> The following table describes the system authorities
|
|
that correspond to the SQL privileges when checking privileges to a table.
|
|
The left column lists the SQL privilege. The right column lists the equivalent
|
|
system authorities.</p>
|
|
<a name="eqtablepr"></a>
|
|
<table id="eqtablepr" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 72. Corresponding System Authorities when Checking Privileges to a Table</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1608" width="50%" align="left" valign="bottom">SQL Privilege</th>
|
|
<th id="wq1609" width="50%" align="left" valign="bottom">Corresponding System Authorities when
|
|
Checking Privileges to a Table</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1608">ALTER</td>
|
|
<td align="left" valign="top" headers="wq1609">*OBJALTER or *OBJMGT</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1608">DELETE</td>
|
|
<td align="left" valign="top" headers="wq1609">
|
|
<div class="lines">*OBJOPR and *DLT<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1608">INDEX</td>
|
|
<td align="left" valign="top" headers="wq1609">*OBJALTER or *OBJMGT</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1608">INSERT</td>
|
|
<td align="left" valign="top" headers="wq1609">
|
|
<div class="lines">*OBJOPR and *ADD<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1608">REFERENCES</td>
|
|
<td align="left" valign="top" headers="wq1609">*OBJREF or *OBJMGT</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1608">SELECT</td>
|
|
<td align="left" valign="top" headers="wq1609">
|
|
<div class="lines">*OBJOPR and *READ<br />
|
|
</div></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1608">UPDATE</td>
|
|
<td align="left" valign="top" headers="wq1609">
|
|
<div class="lines">*OBJOPR and *UPD<br />
|
|
</div></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>The following table describes the system authorities that correspond to
|
|
the SQL privileges when checking privileges to a view. The left column lists
|
|
the SQL privilege. The middle column lists the equivalent system authorities
|
|
that are checked on the view itself. The right column lists the system authorities
|
|
that are checked on all tables and views referenced in the view's definition,
|
|
and if a view is referenced, all tables and views referenced in its definition,
|
|
and so on.</p>
|
|
<a name="eqviewpr"></a>
|
|
<table id="eqviewpr" width="100%" summary="" border="1" frame="border" rules="all">
|
|
<caption>Table 73. Corresponding System Authorities when Checking Privileges to a View</caption>
|
|
<thead valign="bottom">
|
|
<tr>
|
|
<th id="wq1610" width="33%" align="left" valign="bottom">SQL Privilege</th>
|
|
<th id="wq1611" width="33%" align="left" valign="bottom">Corresponding System Authorities to the
|
|
View</th>
|
|
<th id="wq1612" width="33%" align="left" valign="bottom">Corresponding System Authorities to the
|
|
Referenced Tables and Views</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody valign="top">
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1610">ALTER</td>
|
|
<td align="left" valign="top" headers="wq1611">*OBJALTER and *OBJMGT</td>
|
|
<td align="left" valign="top" headers="wq1612">None</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1610">DELETE<sup class="fn"><a href="rbafzmstgnt.htm#fn30">75</a></sup></td>
|
|
<td align="left" valign="top" headers="wq1611">
|
|
<div class="lines">*OBJOPR and *DLT<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1612">*DLT</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1610">INDEX</td>
|
|
<td align="left" valign="top" headers="wq1611">Not Applicable</td>
|
|
<td align="left" valign="top" headers="wq1612">Not Applicable</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1610">INSERT<sup class="fn"><a href="rbafzmstgnt.htm#fngi">76</a></sup></td>
|
|
<td align="left" valign="top" headers="wq1611">
|
|
<div class="lines">*OBJOPR and *ADD<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1612">*ADD</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1610">REFERENCES</td>
|
|
<td align="left" valign="top" headers="wq1611">*OBJREF or *OBJMGT</td>
|
|
<td align="left" valign="top" headers="wq1612">None</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1610">SELECT</td>
|
|
<td align="left" valign="top" headers="wq1611">
|
|
<div class="lines">*OBJOPR and *READ<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1612">*READ</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="left" valign="top" headers="wq1610">UPDATE<sup class="fn"><a href="rbafzmstgnt.htm#fngu">77</a></sup></td>
|
|
<td align="left" valign="top" headers="wq1611">
|
|
<div class="lines">*OBJOPR and *UPD<br />
|
|
</div></td>
|
|
<td align="left" valign="top" headers="wq1612">*UPD</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a name="wq1613"></a>
|
|
<h3 id="wq1613"><a href="rbafzmst02.htm#ToC_1139">Examples</a></h3>
|
|
<p><span class="italic">Example 1:</span> Grant all privileges on the table WESTERN_CR
|
|
to PUBLIC. </p>
|
|
<pre class="xmp"> <span class="bold">GRANT ALL PRIVILEGES ON</span> WESTERN_CR
|
|
<span class="bold">TO PUBLIC</span></pre>
|
|
<p><span class="italic">Example 2:</span> Grant the appropriate privileges on
|
|
the CALENDAR table so that PHIL and CLAIRE can read it and insert new entries
|
|
into it. Do not allow them to change or remove any existing entries. </p>
|
|
<pre class="xmp"> <span class="bold">GRANT SELECT, INSERT ON</span> CALENDAR
|
|
<span class="bold">TO</span> PHIL, CLAIRE</pre>
|
|
<p><span class="italic">Example 3:</span> Grant column privileges on TABLE1 and
|
|
VIEW1 to FRED. Note that both columns specified in this GRANT statement must
|
|
be found in both TABLE1 and VIEW1.</p>
|
|
<pre class="xmp"> <span class="bold">GRANT UPDATE(</span>column_1, column_2<span class="bold">)
|
|
ON </span> TABLE1, VIEW1
|
|
<span class="bold">TO</span> FRED <span class="bold">WITH GRANT OPTION</span></pre>
|
|
<p><a id="idx2847" name="idx2847"></a><a id="idx2848" name="idx2848"></a></p>
|
|
<hr /><div class="fnnum"><a id="objaltr" name="objaltr">72</a>.</div>
|
|
<div class="fntext">The SQL INDEX and ALTER privilege correspond to the same
|
|
system authority of *OBJALTER. Granting both INDEX and ALTER will not provide
|
|
the user with any additional authorities.</div><div class="fnnum"><a id="withhld" name="withhld">73</a>.</div>
|
|
<div class="fntext">If the WITH
|
|
GRANT OPTION is given to a user, the user will also be able to perform the
|
|
functions given by ALTER and REFERENCES authority.</div><div class="fnnum"><a id="fn20" name="fn20">74</a>.</div>
|
|
<div class="fntext">The specified
|
|
rights are only granted to the tables and views referenced in the view definition
|
|
if the user to whom the rights are being granted doesn't already have the
|
|
rights from another authority source, for example public authority.</div><div class="fnnum"><a id="fn30" name="fn30">75</a>.</div>
|
|
<div class="fntext">When a view is created, the owner does not necessarily acquire
|
|
the DELETE privilege on the view. The owner only acquires the DELETE privilege
|
|
if the view allows deletes and the owner also has the DELETE privilege on
|
|
the first table referenced in the subselect.</div><div class="fnnum"><a id="fngi" name="fngi">76</a>.</div>
|
|
<div class="fntext">When a view
|
|
is created, the owner does not necessarily acquire the INSERT privilege on
|
|
the view. The owner only acquires the INSERT privilege if the view allows
|
|
inserts and the owner also has the INSERT privilege on the first table referenced
|
|
in the subselect.</div><div class="fnnum"><a id="fngu" name="fngu">77</a>.</div>
|
|
<div class="fntext">When a view is created, the owner does
|
|
not necessarily acquire the UPDATE privilege on the view. The owner only acquires
|
|
the UPDATE privilege if the view allows updates and the owner also has the
|
|
UPDATE privilege on the first table referenced in the subselect.</div>
|
|
<br />
|
|
<hr /><br />
|
|
[ <a href="#Top_Of_Page">Top of Page</a> | <a href="rbafzmstgntseqp.htm">Previous Page</a> | <a href="rbafzmstholdloc.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>
|