#set TITLE = "command syntax"
#include top

.SH Command syntax
These rules apply to \fBshsql\fR commands:

#include space

.IP \(bu
Query "words" must generally be separated by whitespace.  
Quoted constants are considered one "word" for this purpose.
#set FILE = "commalist.html"
#set TAG = "Comma-delimited lists"
#include link
are considered one word.
Otherwise, commas may trail words, but may not directly precede words.
.br
\fBWrong\fR: \fC SELECT A,B,C FROM TABLE WHERE A>10 \fR
.br
\fBCorrect:\fR \fC SELECT A, B, C FROM TABLE WHERE A > 10 \fR

#include space

.IP \(bu
Parentheses and carriage returns (newlines) may be used anywhere as 
desired for readability, except that newlines may not be embedded in 
literal text strings.

#include space

.IP \(bu
SQL command keywords, function names, and NULL are case insensitive.

#include space

.IP \(bu
Table names and field (column) names are case sensitive, max length 38 characters, 
may not contain any white space or punctuation character other than underscore (_),
and must begin with an alphabetic character.
(Temporary table names follow these rules too except that the first character in a 
temp table name is always the dollar sign ($)).

#include space

.IP \(bu
\fBshsql\fR reserved words should be avoided when choosing table and field names.
The following should definitely not be used (upper or lower case): 
FROM  WHERE  VALUES  INTO  SET  AND  OR  ON  NULL

#include space

.IP \(bu
Literal character strings are case sensitive and may be enclosed in double
quotes (") or single quotes(').  A literal quote may be represented by
supplying a preceding backslash.

#include space

.IP 
Allowable SQL syntax is limited to the constructs illustrated in this manual.
Compound constructs (such as sub-selects) and some other variants are not 
supported.  For example, joins always use "JOIN .. ON" syntax.
#set FILE = "whereclause.html"
#set TAG = "WHERE clauses"
#include link
have some syntax limitations.  

#include space
.IP
No functions() are supported in WHERE clauses, and only
aggregation functions such as count() and avg() are supported in SELECT item lists.
Arithmetic, date and time handling, and string manipulation are not supported in
WHERE clauses or item lists; these must be done by your middleware.


#include space
.IP \(bu
The default wild card character for use in WHERE clauses is *.
To use the standard %, set \fCdbwildcard: %\fR in 
#set FILE = "config.html#dbwildcard"
#set TAG = "your project config file."
#include link

#include space

.IP \(bu
The \fItable\fR.\fIfieldname\fR construct can only be used when a join is being performed.  

#include space

.IP \(bu
The \fIdatabase\fR.\fItable\fR.\fIfieldname\fR construct is not supported anywhere.


#include bottom
