.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: using ordinary files</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 using ordinary files TDH "02-JUN-2005   TDH scg@jax.org" 

.SH Using ordinary files
.LP
An "ordinary file" is a file located anywhere in the unix file system that conforms to the
.ig >>
<a href="tables.html#structure">
.>>
\0shsql table structure.
.ig >>
</a>
.>>
The
.ig >>
<a href="tabletypes.html">
.>>
\0shsql table types chart
.ig >>
</a>
.>>
describes how ordinary files differ in their usage from standard database tables.

.LP
Ordinary files may reside anywhere in the file system.
Ordinary files may be accessed by the \fCSELECT\fR command, in a straight select or a join.
They can be created using \fCSELECT INTO\fR, or by other programs.
Indexes may be built/rebuilt for ordinary files using the SQL
.ig >>
<a href="create.html">
.>>
\0CREATE INDEX
.ig >>
</a>
.>>
command (\fCSELECT\fR can then use the index).
.LP
SQL data-modification operations, including \fCINSERT\fR, \fCUPDATE\fR, \fCDELETE\fR,
\fCMAINTAIN\fR, and \fCALTER\fR, \fBcan not\fR be applied to ordinary files.

.ig >>
<br><br><br>
.>>
.SH Note
Shsql can be used to access ordinary tabular data files exclusively without
using any database tables.
However, a config file and
(at least a skeleton) database structure must still exist, and the SHSQL_DB
environment variable must be set to point to that structure.  See 
.ig >>
<a href="project_setup.html">
.>>
\0the project setup page.
.ig >>
</a>
.>>

.ig >>
<br><br><br>
.>>
.SH Security concerns
Because this feature allows SHSQL to access any readable file on your file system,
avoid situations where table names are built
using user-supplied values (such as CGI user variables).. this might
allow a hacker to see arbitrary files.

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

.SH Naming
When referencing an ordinary file in a \fCSELECT\fR or \fCCREATE\fR command the file's 
full pathname should be used.
The first character in the path name \fBmust\fR be slash (/) or dot (.).

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

.SH Usage examples
Here are some examples:
.IP
.nf
select * from ./trial3/55x25 where intensity > 0.7

select ... into ./lists/problemcases where ...

create index on /home/steve/pubmed/masterlist journal_name
.fi

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

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