#set TITLE = "CREATE STREAM"
#include top

.SH CREATE STREAM
.LP
\fCCREATE STREAM\fR is a \fBshsql\fR SQL command extension that allows a 
shell command to appear to \fBshsql\fR as a temporary table.
Whenever the temporary table is referenced in a \fCSELECT\fR statement, the
shell command is executed.  
.LP
Usage: \fCCREATE  STREAM  \fItemptablename\fC  AS  \fIshellcommand\fR
.LP
\fItemptable\fR names the 
#set FILE = "temptables.html"
#set TAG = "temporary table"
#include link
that will be created.  
.LP
\fIshellcommand\fR is the shell command to be executed.  It will be executed
with the project data directory as its current working directory, at the time
it is accessed in a \fCSELECT\fR command.
The \fIshellcommand\fR must produce a data stream on its standard output that 
has a fieldname header and fields/records delimited appropriately.
.LP
Security concern: Avoid building \fIshellcommand\fR with user-supplied values.
If this must be done, care must be taken to process the user-supplied values
first to remove shell meta characters, quote 
characters, semi-colons, etc.
Otherwise malicious users may be able to execute arbitrary commands.
.LP
\fBExample:\fR
\fC CREATE STREAM $tmp1 AS compstats 65 gbvol M\fR


#include bottom
