ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzatc_5.4.0.1/rzatcview.htm

70 lines
3.9 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="copyright" content="(C) Copyright IBM Corporation 2005" />
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2005" />
<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="task" />
<meta name="DC.Title" content="Create and use a view" />
<meta name="DC.Relation" scheme="URI" content="rzatcgetstartinav.htm" />
<meta name="DC.Relation" scheme="URI" content="rzatcsingletable.htm" />
<meta name="DC.Relation" scheme="URI" content="rzatcwhere.htm" />
<meta name="DC.Relation" scheme="URI" content="rzatcmulttables.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzatcview" />
<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>Create and use a view</title>
</head>
<body id="rzatcview"><a name="rzatcview"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Create and use a view</h1>
<div><div class="section">You might find that no single table contains all the information
you need. You might also want to give users access to only part of the data
in a table. Views provide a way to divide the table so that you deal with
only the data you need. A view reduces complexity and, at the same time, restricts
access. <p>In order to create a view, you must have the correct authority
to the tables or physical files on which the view is based. See the <a href="../db2/rbafzmsthcview.htm">CREATE VIEW</a> statement
in the SQL Reference topic for a list of authorities needed.</p>
<p>If you
did not specify column names in the view definition, the column names are
the same as those for the table on which the view is based.</p>
<p>You can
make changes to a table through a view even if the view has a different number
of columns or rows than the table. For INSERT, columns in the table that are
not in the view must have a default value. </p>
<p>You can use the view as
though it were a table, even though the view is totally dependent on one or
more tables for data. The view has no data of its own and therefore requires
no storage for the data. Because a view is derived from a table that exists
in storage, when you update the view data, you are really updating data in
the table. Therefore, views are automatically kept up-to-date as the tables
they depend on are updated. </p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzatcsingletable.htm">Create a view over a single table</a></strong><br />
</li>
<li class="ulchildlink"><strong><a href="rzatcwhere.htm">Create a WHERE clause</a></strong><br />
</li>
<li class="ulchildlink"><strong><a href="rzatcmulttables.htm">Create a view combining data from multiple tables</a></strong><br />
</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzatcgetstartinav.htm" title="This tutorial describes how to create and work with schemas, tables, and views using iSeries Navigator.">Get started with iSeries Navigator</a></div>
</div>
</div>
</body>
</html>