Formatting Escapes: Argument escapes

The portion of a URL after a ? is known as the query string. dbCGI breaks up this query string into arguments at the + character. The arguments are then accessible using the escapes in this section. While the + character is normally used to represent the space character in a query string, if you wish to have a space character appear in a dbCGI argument you will need to use the %20 sequence in the URL instead.

The URL http://www.example.com/dbcgi/test.sql?abc%20123+def%2Bghi+jklmn contains three arguments:

Argument 1 abc 123
Argument 2 def+ghi
Argument 3 jklmn

If you want to use the query string without having it broken into arguments, it is still accessible as %[$QUERY_STRING%] (see the %[$...%] escape).

%na - substitute an argument
%nt - substitute a possibly empty argument as an SQL string constant
%nq - substitute a possibly empty argument as an SQL string constant
%{...%} - escape a string so it can be used as an argument.