#set TITLE = "using ordinary files"
#include top

.SH Using ordinary files
.LP
An "ordinary file" is a file located anywhere in the unix file system that conforms to the
#set FILE = "tables.html#structure"
#set TAG = "shsql table structure."
#include link
The
#set FILE = "tabletypes.html"
#set TAG = "shsql table types chart"
#include link
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
#set FILE = "create.html"
#set TAG = "CREATE INDEX"
#include link
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.

#include space
.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 
#set FILE = "project_setup.html"
#set TAG = "the project setup page."
#include link 

#include space
.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.

#include space

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

#include space

.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

#include space

#include bottom
