picoSQL - Language reference manual


2) Language elements


numbers

A number is any sequence of digits followed by an optional decimal part and preceded by an optional negative sign. Exponential notation is allowed postplacing an 'E' and then an exponent. For example:

523

-43.001

7.8E5

3.4E-3


strings

A string is any sequence of characters enclosed in single or double quotes (SQL standard allows only single quotes). A quote is represented inside the string by two adjacent quotes. The following strings are equivalent.

"L'opera"

'L''opera'


escape sequences

Dates are not numbers nor strings, so an escape sequence is needed to identify a date type. picoSQL use curly braces to enclose these values. Allowed escape sequences are:

{d 'YYYY-MM-DD'} to represent a date;

{t 'hh:mm:ss.uuu'} to represent a time;

{ts 'YYYY-MM-DD hh:mm:ss.uuu'} to represent a timestamp;


literal values

Any string value, numeric value or date value is called literal value.


dynamic parameters

When using picoSQL in a procedural language, some values of a query are often contained in a host variable. Because of this, you can prepare a query using the question mark character (?) instead of a literal value. In these cases of course, you need to supply the correct value before executing the query using an appropriate function call (SQLBindParameter).


identifiers

An identifier is a name who identify a database element, like a table or a table attribute. The name can be any sequence of characters A through Z, a through z, 0 through 9 and underscore (_). The first character must be a letter. picoSQL do not distinguish between upper and lower case. An identifier name cannot be a keyword.


separators

A SQL command is a sequence of words separated by special characters, called separators. There are two kinds of separators. The first type is used only to separate the words and has no special meaning. Separators of this kind are the blank character (ASCII 32), tabulator (ASCII 9), carriage return (ASCII 13) and new line (ASCII 10).

The second type of separators has a special meaning. Separators of this kind are the following:

, ( ) < > . = * + - / ?

and the following characters couples:

<> != >= <=



Index Previous Next