Directives: Introduction

dbCGI directives are used to direct dbCGI to perform actions, including database access and other procedural actions.

A dbCGI directive is case sensitive and has one of the following forms:

<sql command [identifier]>...</sql>
<sql command [identifier]/>

The first form is used when including contents in the directive, and the second form is preferred when there are no contents.

The contents of a directive

The contents of directives come in four categories: unstructured, name-value pairs, nested dbCGI content, and comma separated values.

Unstructured

<sql command [identifier]>
data
</sql>

Unstructured content in an directive is normally only unstructured from the point of view of dbCGI - it may have meaningful structure, but the structure is interpreted by something other than dbCGI. For example, its contents may be a section of HTML or a Structured Query Language command.

Formatting escapes inside unstructured directives are normally interpreted just before the contents are used.

Name-Value pairs

<sql command [identifier]>
name1=value1
name2=value2
.
.
namen=valuen
</sql>

The name-value pairs are separated by line breaks. Initial white space on a line is discarded, but white space after the first non-white-space character is significant: NAME = value is not the same as NAME=value - the first has a name ending with a space, and a value starting with a space.

Names in name-value pairs are case sensitive.

Formatting escapes in name-value pairs are normally interpreted before the values of the name-value pairs are read.

Nested dbCGI content

<sql command [identifier]>
data-or-html
<sql command [identifier]>
data-or-html
</sql>
data-or-html
</sql>

A directive containing nested dbCGI content allows other directives inside it to be interpreted. This form of dbCGI directive is used for control flow directives and action-handling directives.

Formatting escapes in nested dbCGI content directives are normally interpreted just before the contents are used.

Comma separated values

<sql command [identifier]>value1, value2, value3</sql>

Comma separated value content is used for templates. Formatting escapes are not interpreted at all in comma separated value content, although the individual values may be subjected to formatting escape interpretation when substituted into the template.