.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>shsql: tables organized hierarchically</title>
<body bgcolor=99cc99 vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td align=right><a href="shsql_home.html">
<img src="img/shsql.gif" border=0><br><small>SQL database system</a> &nbsp; </td></tr>
<td>
.>>

.TH Tables organized hierarchically TDH "18-MAR-2004   TDH scg@jax.org" 

.SH Tables organized hierarchically
.LP
Hierarchical structures are sometimes useful.  To accomodate this,
\fBshsql\fR allows for collections of data tables to be organized hierarchically.
The tables in the hierarchy can all share the same format, or have different formats.
See also the
.ig >>
<a href="tabletypes.html">
.>>
\0shsql table types chart.
.ig >>
</a>
.>>
.LP
A hierarchy is created by making a subdirectory in the database \fCdata\fR directory.
Data table files can then be created in the subdirectory using
.ig >>
<a href="create.html#table">
.>>
\0CREATE TABLE.
.ig >>
</a>
.>>
Table names are relative to the \fCdata\fR directory.
For example, after you make a directory in your \fCdata\fR directory called
\fCcases\fR, you can issue this CREATE command:
.nf
	create table cases/2002_03 ( field1, field2 .. fieldn )
.fi
.LP
These data files may be referenced similarly in SQL
\fCSELECT\fR, \fCINSERT\fR, \fCDELETE\fR, and \fCUPDATE\fR commands, like this: 
.LP
\fCselect * from cases/2002_03\fR
.LP
To concatenate multiple files from the hierarchy together for treatment as a single table, 
.ig >>
<a href="createstream">
.>>
\0CREATE STREAM
.ig >>
</a>
.>>
can be used along with
.ig >>
<a href="dbcat.1.html">
.>>
\0dbcat(1).
.ig >>
</a>
.>>

.ig >>
<br><br><br>
.>>

.SH Example
An example of a hierarchical collection of tables is included in \fCsqlexampledb\fR.
See \fCtestruns/README\fR.

.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="shsql_home.html">
<img src="img/shsql.gif" border=0></a><br>
<a href="Copyright.html">Copyright Steve Grubb</a> &nbsp;
</td></tr>
</table>
.>>

