.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: temporary tables</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 Temporary tables TDH "18-MAR-2004   TDH scg@jax.org" 

.SH Temporary tables
Temporary tables are created using the 
.ig >>
<a href="select.html#into">
.>>
\0SELECT INTO
.ig >>
</a>
.>>
or 
.ig >>
<a href="createstream.html">
.>>
\0CREATE STREAM
.ig >>
</a>
.>>
commands.
After a temp table is created it may be accessed like any other table using \fCSELECT\fR.
Temporary tables are unique to a
process; one process cannot access or modify temp tables created by another process
(if you need to do this, use
.ig >>
<a href="ordfiles.html">
.>>
\0ordinary files
.ig >>
</a>
.>>
instead).
Temp tables cannot be manipulated using \fCINSERT\fR, \fCUPDATE\fR, or \fCDELETE\fR,
nor can indexes be created for them.
See also the
.ig >>
<a href="tabletypes.html">
.>>
\0shsql table types chart.
.ig >>
</a>
.>>


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

.SH Names
\fBshsql\fR temp table names always begin with a dollar sign ($).  Otherwise temp table names
follow the same naming rules as
.ig >>
<a href="tables.html">
.>>
\0regular tables.
.ig >>
</a>
.>>

.LP
Temporary tables provide a way of "chaining" or combining commands.
These are particularly useful with \fBshsql\fR since the more elaborate forms of
some commands aren't supported.  For instance, you can put the results of
a two-table join into a temp table, then join that temp table against another
table.  
.LP

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

.SH Removing temp tables
.ig >>
<a href="drop.html">
.>>
\0DROP TEMPTABLE
.ig >>
</a>
.>>
may be used to explicitly remove temporary tables.

.ig >>
<a name=cleanup></a>
.>>
.ig >>
<br><br><br>
.>>

.SH Cleaning up old temp table files
Temp tables are stored as files either in \fCtmpdir\fR or \fCdbtmptabledir\fR as defined in the 
.ig >>
<a href="config.html">
.>>
\0project config file
.ig >>
</a>
.>>
Old temp table files may accumulate over time and these should be
.ig >>
<a href="maint.html#other">
.>>
\0cleaned up periodically.
.ig >>
</a>
.>>

.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>
.>>
