XCDSQL Homepage: XML (en)Coded and Documented SQL - eXCeeDs Sequel Logo: <eXCeeDSeQueL>

XCDSQL Homepage

XML (en)Coded and Documented SQL - eXCeeDs Sequel
Keywords:
XML, SQL, platform-independant database programming
Authors:
R.P. Bouman <roland.bouman@xcdsql.org>

Abstract

This document introduces XCDSQL. XCDSQL is an abbreviation of XML (en)Coded and Documented SQL, and is pronounced as exceeds sequel. XCDSQL is a computer programming language that employs the semantics of Structured Query Language, (abbreviated SQL, and sometimes pronounced as sequel), and conforms syntactically to the Extensible Markup Language (abbreviated XML).

The primary goal of XCDSQL is to facilitate SQL-agents to formulate commands for multiple SQL-implementations. The secondary goal of XCDSQL is to encourage documentation of such commands.

Status of this document

This document is yet unreviewed. It may be considered as a announcement of the initial specification of XCDSQL. Feedback on this document is greatly appreciated, and may be submitted to feedback@xcdsql.org. Any errors found in this document may be reported to errors@xcdsql.org.


Table of Contents

1  Introduction
1.1  Origin and Goals
1.2  Definitions and Terminology
2  SQL
3  XML
4  SQL in XML: XCDSQL
A. DTD for XCDSQL (non-normative)

1 Introduction

XML(en)Coded and Documented SQL, abbreviated XCDSQL and pronounced as exceeds sequel, describes a class of XML-documents (XCDSQL-documents or XCDSQL-programs) that describe the definition and/or manipulation of objects, events and structures (database-objects) associated with and/or maintained by (relational) database management systems (RDBMS). An XCDSQL-document can be thought of as a computer program in the sense that the semantics of the definitions and/or manipulations of database-objects it describes, could be realized on an actual database management system, resulting in the actual definition and/or manipulation of corresponding and equivalent database-objects.

Presently, no (database) platform exists that is capable of interpreting or compiling XCDSQL-programs directly. Nor is one needed: XCDSQL-programs are primarily intended to be translated rather than executed. Translation is to result in some native or platform-dependant source-code (target-platform source-code), typically some SQL-dialect, that can be interpreted or compiled and then executed. Although XCDSQL is a language that is not intended to be interpreted or compiled directly, there are no inherent objections against constructing such a platform.

Because an XML-syntaxis is used to encode the SQL-semantics, building a program that translates XCDSQL into target-platform source-code supposes no more than the construction of a XSLT-stylesheet. The construction of a particular translation can be initiated in an ad-hoc manner whenever one is actually needed.

1.1 Origin and Goals

Although XCDSQL employs concepts defined in the ANSI/ISO/IEC International Standard (IS): Database Language SQL, and uses some of the keywords defined therein as element and attribute names, there is no formal connection between both languages; nor is there any formal relationship between the organizations involved in developing these languages. Although XCDSQL employs concepts defined in the W3C Recommendation Extensible Markup Language, and conforms to the syntaxis defined therein, there is no formal connection between both languages, other than that XCDSQL conforms to the XML-syntaxis; nor is there any formal relationship between the organizations involved in developing these languages. Although this document suggests employment of XSLT-technology to transform XCDSQL-programs into interpretable, compilable or executable, platform-dependant code, no formal relationship exists between XCDSQL and XSLT; nor is there any formal relationship between the organizations involved in developing these XML-applications. Although this document suggests employment of XSLT-technology as a means to transform XCDSQL-programs into some target-platform source-code, no objection is intended against any other means or technology of performing such transformations.

The design goals for XCDSQL are:

1.2 Definitions and Terminology

The terms and definitions that are used throughout this document are explained below.
DBMS
An application program that acts as a database management system, that is the software that maintains database-objects
database-object
Some data-structure or definition residing in and maintained by a DBMS
semantics
The total of the concepts, structures and manipulations belonging to a language
source-code
Some sequence of charactersymbols or -tokens that may be interpreted as a definition of, and possible transformed (e.g. interpreted or compiled) into, an executable program by some target-platform
SQL
Structured Query Language.
syntaxis
The total of rules that together describe the pattern of character-sequences that may be interpreted as an sentence belonging to the language of which it is a syntaxis
target-platform
Some application program that is capable of executing programs previously specified in some source-code.
XCDSQL
The XML-(en)Coded and Documented Structured Query Language; the programming language described in this document.
XCDSQL-document
A XML-document conforming to the syntaxis defined for the XCDSQL programming language, usully a XCDSQL-program.
XCDSQL-program
A computer program that is written in the XCDSQL-programming language.
XML
The Extensible Markup Language.

2 SQL

SQL originated as a language for working with relational databases. It is an abbreviation of Structured Query Language. Most relational database management systems implement some variant or of SQL, or so-called SQL-dialect. Although attempts have been made to achieve standardization, there is no RDBMS that implements the full range of constructs defined in the latest, or even the earlier specifications of the standard. It is beyond the scope of this document to present an overview of all SQL-dialects, or even the ANSI/ISO/IEC standards. Instead, reading of the Summary of SQL is recommended.

3 XML

XML is an application profile or restricted form of SGML, the Standard Generalized Markup Language [ISO 8879]. XML was developed by an XML Working Group formed under the auspices of the World Wide Web Consortium (W3C) in 1996. XML-syntaxis has proved to be successfully employable for various applications including data-formats (RDF,XTM), markup-languages (XHTML) or programming lanuages (XUL,XSLT). It is beyond the scope of this document to reflect upon the applicability, benefits and restrictions of XML

4 SQL in XML: XCDSQL


Appendices

A DTD for XCDSQL (non-normative)

The DTD for XCDSQL documents is given below. This DTD is to be considered as draft. It only serves to give a taste of how XCDSQL-programs will look like. The DTD is soon to be replaced by a XMLSchema.

<!--===========================================

Miscellaneous entities


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All data manipulation statements
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ENTITY % db-ref.attrib " db NMTOKEN #IMPLIED ">
<!ENTITY % schema-ref.attrib " schema NMTOKEN #IMPLIED ">
<!ENTITY % table-name-ref.attrib " name NMTOKEN #IMPLIED ">
<!ENTITY % object-name.attrib.required " name NMTOKEN #REQUIRED ">
<!ENTITY % object-name.attrib.implied " name NMTOKEN #IMPLIED ">
<!ENTITY % table-alias.attrib " name NMTOKEN #IMPLIED ">
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A relational expression
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some operation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The built-in global boolean variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The built-in variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An expression that may be evaluated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
One or more Value-expressions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A logical expression
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A boolean expression
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A boolean expression
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An optional conditon
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================
Datatypes

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
May be used for all elements that have a datatype
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ENTITY % datatype " type CDATA #REQUIRED length CDATA #IMPLIED scale CDATA #IMPLIED charset CDATA #IMPLIED collate CDATA #IMPLIED ">
<!--===========================================
Character String types

============================================-->
<!ENTITY char "CHARACTER">
<!ENTITY charv "CHARACTER VARYING">
<!ENTITY clob "CHARACTER LARGE OBJECT">
<!--===========================================
Binary String type

============================================-->
<!ENTITY blob "BINARY LARGE OBJECT">
<!--===========================================
Bit String types

============================================-->
<!ENTITY bit "BIT">
<!ENTITY bit "BIT VARYING">
<!--===========================================
Exact numeric types

============================================-->
<!ENTITY num "NUMERIC">
<!ENTITY dec "DECIMAL">
<!ENTITY int "INTEGER">
<!ENTITY sint "SMALLINT">
<!--===========================================
Approximate numeric types

============================================-->
<!ENTITY float "FLOAT">
<!ENTITY real "REAL">
<!ENTITY double "DOUBLE PRECISION">
<!--===========================================
Boolean type

============================================-->
<!ENTITY bool "BOOLEAN">
<!--===========================================
Datetime types

============================================-->
<!ENTITY date "DATE">
<!ENTITY time "TIME">
<!ENTITY tstamp "TIMESTAMP">
<!--===========================================
Interval types

============================================-->
<!ENTITY range "INTERVAL">
<!--===========================================
All set operations

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set operations A set operation operates on two table-expressions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================
Table expresssions

============================================-->
<!--===========================================
Query structure and Select expressions

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifying a query starts by specifying what data should be queried. This is done by specifying a table expression Optionally, the data is reduced by filtering it against a condition. Only The data for which the condition is true, is maintained Optionally, individual units of data (rows) may be grouped. Optionally, a filter may be applied to these groups From the data that now remains, individual items may be picked.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The elements that encode selective code control.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The elements that encode iterative code control.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The elements that encode sequential code control.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All elements that encode code-flow control.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structural features.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Declarations.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Operations that may be performed on a cursor.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executables.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executables.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exception or Error handlers.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An optional value-expression for initializing a variable.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The content model for block-like structures.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The content model for invokeables.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Miscellaneous elements


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Refers to some schema object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Document element.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Includes a valid xcdsql resource. Using this element is equivalent to using an general entity-ref that identifies the resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT incl  (doc?)>
<!-- The uniform resource identifier from where the contents of the resource may be collected. -->
<!ATTLIST incl uri   CDATA   #REQUIRED>
<!--===========================================

Documentation


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Includes documentation.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT doc ANY>
<!-- The type of documentation, implementation or functional -->
<!ATTLIST doc type   (func|impl)   "func">
<!-- The css style attribute -->
<!ATTLIST doc style   CDATA   #IMPLIED>
<!-- The name of the html-tag to markup this documentation -->
<!ATTLIST doc tag   (a|abbr|acronym|address|applet|area|b|base|basefont|bdo|big|blockquote|body|br|button|caption|center|cite|code|col|colgroup|dd|del|dfn|dir|div|dl|dt|em|fieldset|font|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|hr|html|i|iframe|img|input|ins|isindex|kbd|label|legend|li|link|map|menu|meta|noframes|noscript|object|ol|optgroup|option|p|param|pre|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|ul|var)   "div">
<!-- The css class attribute -->
<!ATTLIST doc class   NMTOKEN   #IMPLIED>
<!-- The css style attribute -->
<!ATTLIST doc style   CDATA   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets an attribute value for the html-element specified by it's parent doc element. The attribute is identified by the name attribute, whereas the value is specified as pcdata content.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT doc-att  (#PCDATA)>
<!-- The name of the attribute. -->
<!ATTLIST doc-att name   NMTOKEN   #REQUIRED>
<!--===========================================

The built-in global variables


============================================-->
<!--===========================================
The built-in global boolean variables

============================================-->
<!--===========================================

Operator constructs


============================================-->
<!--===========================================

Arithmic Operations


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds all of it's arguments. Equivalent to an arithmic +.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Concatenates all of it's arguments. Equivalent to sql ||.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Divides all of it's arguments. Equivalent to an arithmic /.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns e raised to the power of the argument.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the factorial of it's argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Takes the natural logaritm of it's argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Takes the logaritm of all of its arguments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Takes the base 10 logaritm of its argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unary minus.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modulus of all of it's arguments.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Multiplies all of it's arguments. Equivalent to an arithmic *.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unary plus.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Raise to the power.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Root.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Subtracts all of it's arguments. Equivalent to an arithmic -.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Relational Operations

Relational expressions take non-boolean arguments and return a boolean value

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if the first argument matches the pattern specified by the second argument The pattern may use the percent and the underscore sign as metacharacters. In the pattern, a percent character is interpreted as zero or more arbitrary characters, the underscore is interpreted as an arbitrary character, and every other character is represents itsself. If a metcharacter is needed literally in the pattern, it must be escaped. In this case, the metacharacter may be escaped by a single escape character which must appear right before the metacharacter. The escape character may be specified as the third argument.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if the first argument matches the pattern specified by the second argument The pattern must be specified as a regular expression.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if all of it's arguments are equal to each other. If the arguments are not all of the same type, conversion is applied implicitly. In that case, conversion should take place before the comparisons, and there should be only on target type of the conversion.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if each argument is greater than it's subsequent argument. If the arguments are not all of the same type, conversion is applied implicitly. In that case, conversion should take place before the comparisons, and there should be only on target type of the conversion.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if each argument is greater than or equal to it's subsequent argument. If the arguments are not all of the same type, conversion is applied implicitly. In that case, conversion should take place before the comparisons, and there should be only on target type of the conversion.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if each argument is less than it's subsequent argument. If the arguments are not all of the same type, conversion is applied implicitly. In that case, conversion should take place before the comparisons, and there should be only on target type of the conversion.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if each argument is less than or equal to it's subsequent argument. If the arguments are not all of the same type, conversion is applied implicitly. In that case, conversion should take place before the comparisons, and there should be only on target type of the conversion.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if all of it's arguments are null.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if noe of it's arguments are null.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns true if and only if none of it's arguments are equal to one another. If the arguments are not all of the same type, conversion is applied implicitly. In that case, conversion should take place before the comparisons, and there should be only on target type of the conversion.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Logical Operations

Logical expressions. Logical expressions take boolean arguments and return a boolean value

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
is true if and only if all if it's arguments are true
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
is true if and only if all if it's arguments are false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
is true when one or more arguments are true
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Schema definition


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifies a default value for a column
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifies a derived column value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Constructs


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Alters some database object.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creates some database object.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Destroys some database object.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Schema objects


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a check constraint
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifies a table or view column.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT col (%col-init;,%optional-constraints;)>
<!-- The name for this column. -->
<!ATTLIST col name   NMTOKEN   #REQUIRED>
<!ATTLIST col %datatype;>
<!-- The nullability for this column. -->
<!ATTLIST col nullable   (false|true)   "true">
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a generator. When the call content is not present, equivalent to a SEQUENCE in Oracle, or an IDENTITY column in MSSQL Interbase implements generators.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT gen  (call?)>
<!ATTLIST gen %schema-object.optional-identifier.attrib;>
<!-- The initial value -->
<!ATTLIST gen init   CDATA   "1">
<!-- The increment -->
<!ATTLIST gen inc   CDATA   "1">
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines an unique constraint , or primary key
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT key  (col-ref*)>
<!ATTLIST key %table-ref.attrib;>
<!ATTLIST key %object-name.attrib.implied;>
<!ATTLIST key type   (primary|unique)   "unique">
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A module.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A procedure.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a foreign key constraint
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT ref (col-ref*,tab-ref)>
<!ATTLIST ref %table-ref.attrib;>
<!ATTLIST ref %object-name.attrib.implied;>
<!-- Is this a primary key. -->
<!ATTLIST ref primary   (false|true)   "false">
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a database table.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a trigger.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines a database view.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Data manipulation constructs


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A non-top level query.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A top level query. The sequence op operations described for a query may be expanded by sorting the result rows This is only meaningful for top level queries.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
defines a single row select
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Adds records to a view or table.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT insert (%optional-condition;,col-ref*,(%value-expressions;|select))>
<!-- Identifies the table that recieves the insert -->
<!ATTLIST insert %table-ref.attrib;>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Changes existing data present in a view or table.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT update (%optional-condition;,col-ref*,(%value-expressions;|select))>
<!-- Identifies the table that recieves the update -->
<!ATTLIST update %table-ref.attrib;>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Removes records from a view or table.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT delete %optional-condition;>
<!-- Identifies the table that recieves the delete -->
<!ATTLIST delete %table-ref.attrib;>
<!--===========================================
The set operations

============================================-->
<!--===========================================
The non-set operations

============================================-->
<!ELEMENT col-ref  EMPTY>
<!ATTLIST col-ref %table-ref.attrib;>
<!ATTLIST col-ref %object-name.attrib.required;>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Speceifies that the cartesian product of all it's arguments should be used
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifies that the data from two tables should be joined. If the using attribute is defined, the tables are joined according to the condition that may be generated from the specfied foreign key
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT join (%table-expression;,%table-expression;,%relational-operation;)>
<!-- The type of this join -->
<!ATTLIST join type   CDATA   "inner">
<!-- The name of a foreign key that may be used to construct the join condition -->
<!ATTLIST join using   NMTOKEN   #IMPLIED>
<!--===========================================
Subqueries

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A boolean expression that is true if and only if the first argument is found in the second argument.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A boolean expression that is true if and only if it's argument yields at least one row.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================
Other query contents

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifies that groups of rows should be returned instead of individual rows.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifies the order in which the final result set must be returned
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================

Transaction control constructs


============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makes changes to the database persistent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT commit  EMPTY>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Undoes uncommitted changes made to the database. By specifying the savepoint attribute, only the changes made after the creation of the savepoint are rolled back.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT rollback  EMPTY>
<!-- The name of the savepoint up to where rollback must be performed -->
<!ATTLIST rollback savepoint   NMTOKEN   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creates a savepoint.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT savepoint  EMPTY>
<!-- The name that identifies this savepoint -->
<!ATTLIST savepoint name   NMTOKEN   #REQUIRED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Destroys a savepoint.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT release  EMPTY>
<!-- The name that identifies the savepoint -->
<!ATTLIST release savepoint   NMTOKEN   #REQUIRED>
<!--===========================================

Access control constructs


============================================-->
<!ELEMENT allow ANY>
<!ELEMENT deny ANY>
<!--===========================================

Procedural constructs


============================================-->
<!--===========================================
The compilation-units: non-invokeable

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A block.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT block %block.content;>
<!-- Identifies this block. -->
<!ATTLIST block label   NMTOKEN   #IMPLIED>
<!--===========================================
The compilation-units: invokeable

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A parameter for an invokeable.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT param %optional-value-expression;>
<!-- Identifies this parameter. -->
<!ATTLIST param name   NMTOKEN   #REQUIRED>
<!ATTLIST param %datatype;>
<!ATTLIST param mode   (in|out|inout)   "in">
<!--===========================================
The declarations

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
declares an error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT err  EMPTY>
<!-- identifies this error -->
<!ATTLIST err
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Declares an immutable variable.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT const %value-expression;>
<!-- The name that identifies this constant within its block. -->
<!ATTLIST const name   NMTOKEN   #REQUIRED>
<!ATTLIST const %datatype;>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Declares a variable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT var %optional-value-expression;>
<!-- The name that identifies this variable within its block. -->
<!ATTLIST var name   NMTOKEN   #REQUIRED>
<!ATTLIST var %datatype;>
<!--===========================================
flow-control

============================================-->
<!--===========================================
flow-control: sequence

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An invocation of a procedure or function, transferring control to the procedure or function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT call  (assn*)>
<!-- The name of the procedure or function. -->
<!ATTLIST call routine   NMTOKEN   #REQUIRED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exits a block, loop, choose or if. If the condition is specified, the exit is performed once the condition evaluates to true.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT exit %optional-condition;>
<!-- If specified, the label of block to exit, or else that of the current block. -->
<!ATTLIST exit block   NMTOKEN   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Transfers control to another block
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT goto %optional-condition;>
<!-- The label of the block from where execution will resume. -->
<!ATTLIST goto block   NMTOKEN   #REQUIRED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns from a function or procedure. The value expression is ignored for procedures. If the value-expression is ommited, the function will return null.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Throws an error, thereby transferring control to any catcher catching the error Issue: right now, you can't dynamically decide what error to throw coz' the error is specified as an atribute.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT throw  EMPTY>
<!-- The name of the error. -->
<!ATTLIST throw err   NMTOKEN   #REQUIRED>
<!--===========================================
flow-control: iteration

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specifies repetition.

Iteration

A loop is like block. Like a block, a loop may have declarations, executables and catchers. Unlike a block, a loop repeatedly executes it's executables. One single run through the executables is referred to as an iteration.

Why iterate

Loops are most conveniently used to solve a task that is composed of multiple similar tasks. Each iteration solves one of these subtasks.

Loop control

No well-written loop is intended to repeat it's executables forever. Instead, most loops are intended to iterate just as many times as is needed to solve all the subtasks of the task the loop is supposed to solve. Executables that in some way determine when iteration stops are said to control the loop. Collectively these may be referred to as the loop control.

Please stop, I want out!

In xcdsql, only the exit element actually stops iteration. However, the concept of loop control is more than just stopping the loop; it also has to do with the circumstances that decide if and when iteration should be stopped, e.g. with the conditions that make an exit appropriate, and with the executables that check those conditions.

Imlicit vs Explicit loop contol

One can divide the declarations and executables appearing within a loop into two kinds, namely those that may be regarded as part of the loop control, and those that are not. The latter are usually the those that perform the actual work or solve the actual problem that is the raison d'etre for the loop as a whole. The former are usually encountered in many different loops, whereas the latter are usually quite specific for a particular loop. When we would regard the non-loop control ones as the flesh of a loop, the loop control may be adequately considered as the bone or skeleton that structures the loop.

Implicit loop control

A xcdsql-loop is said to be implicitily controlled when only a functional distinction can be made between loop control and non-loop control declarations and executables. The executables and declarations that are concerned with controlling the loop are intermingled with ones that do the actual work.

Explicit loop control

A xcdsql-loop is said to be explicitly controlled when the loop contains any of special loop-control elements. There are four such elements: before-all, before-each, after-each and after-all. The before-all element is executed before any iteration, the before-each is executed before each iteration, the after-each is executed after each iteration, and the after-all is executed after the last iteration. If the loop happens not to iterate at all because the before-all exits before a iteration was made, the before-each and the after-all are not executed. The intended use of the loop control elements is to insulate the loop control executables from the other executables, thereby offering the possibility to create a formal distinction between the loop control and non loop control executables. This enables a developer or programmer to focus on either aspect of a particular loop. The formal distinction is useful for both writing and for reading code.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executed before the loop starts iterating. Structurally, it is equivalent to an ordinary block. This is the natural place to decide whether to loop should iterate at all, initialize loop control variables or take appropriate action when the if is taken not to iterate. Also, if you set up a loop to iterate through a cursor, this is the natural place to open that cursor. When an exit is performed within this element, the loop is exited alltogether, and no before-each or after-all is executed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executed before each iteration. Structurally, it is equivalent to an ordinary block. This is a natural place to put executables that advance control variables. Also, if you set up a loop to iterate through a cursor, this is the natural place to fetch from that cursor. When an exit is performed within this element, the loop is not immediately exited until the after-all has executed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executed after each iteration. Structurally, it is equivalent to an ordinary block. This is a natural place to check whether the loop should exit or carry on iteration. If you set up a loop to iterate through a cursor, this is the natural place to check if the cursor still has records, giving you the opportunity to decide wheter to fetch or exit. If an exit is performed inbetween the before-each and this element or within this element, the after-each is still executed.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executed after the last iteration. Structurally, it is equivalent to an ordinary block. This is a natural place to compute some final result, and reset variables. If you set up a loop to iterate through a cursor, this is the natural place to close the cursor.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================
flow-control: choice

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are two kinds of chooses depending upon the contents of it's choice (and else) children. The choice (and else) children can contain either one value-expression and executables, or two value-expressions. The content-type must be the same for all choice (and else) children within the same choose. When it's choice and (else children) contain a value-expression and executables, the executables of the choice of wich the value-expression matches that of this choose are executed. If no choice can be made and the else is present, the executables of the else are executed instead. This construct is equivalent to a switch-case construct (c,java), or simple-case construct (sql). When it's choice children contain two value-expressions, the choose is itself a value-expression equal to the value-expression of the choice of which the first value expression matches that of this choose. If no choice can be made and the else is present, the value of the choose is equal to the value-expression child of the else. If no else is present, the entire choose evaluates to null. This construct is like the decode (oracle) or case-when (sql).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
One choice within a choose. The execuatables of the choice are executed if (and only if) it's value-expression matches the value-expression of it's choose.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are two kinds of decide, depending upon the children of it's if (and else). The if (and else) children can contain either a condition and executables, or a condition and a value expression. The content type must be the same for all if (and else) children within the same decide. When the if (and else) children contain a condition and executables, the executables of the first of it's ifs having a condition that evaluates to true are executed. If no if can be made and the else is present, the executables of the else are executed instead. This construct is equivalent to a if-then-elsif-else construct, or searched-case construct (sql). When the if (and the else) children contain a condition and a value expression, the decide is itself a value-expression, that evaluates to the value-expression of the first if of which the condition is found to be true. If no condition of either if is found to be true, and the else is present, the decide evaluates to the value-expression in the else. If no else is present, the entire decide evaluates to null.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executes it's executables if (and only if) it's condition is true. This construct is equivalent to a if-then construct.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executes code if no decision or choice was made
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================
The cursor declarations and operations

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Declares a cursor. A cursor is a select whose result-set may be traversed procedurally using the cursor operations.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT cursor (param*,select)>
<!-- The name that identifies this cursor -->
<!ATTLIST cursor name   NMTOKEN   #REQUIRED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opens a cursor. The possibility exists of declaring the cursor within the open statement. If the cursor attribute is defined, it refers to a predefined cursor. If both the cursor attribute and the inline cursor declaration are present, the latter takes precedence. If assignments are specified, they are used to initialize the cursor's parameters.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT open (cursor?,assn*)>
<!-- The name of a predeclared cursor -->
<!ATTLIST open cursor   NMTOKEN   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
closes a cursor. All resources associated with the cursor are released.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT close  EMPTY>
<!-- The name of an opened cursor -->
<!ATTLIST close cursor   NMTOKEN   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fetches a row from an opened cursor.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT fetch  EMPTY>
<!-- The name of an opened cursor -->
<!ATTLIST fetch cursor   NMTOKEN   #IMPLIED>
<!-- What to fetch. Applies to scrollable cursors -->
<!ATTLIST fetch what   NMTOKEN   "next">
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the value of a system property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT system-prop  EMPTY>
<!-- The name of the property -->
<!ATTLIST system-prop prop   CDATA   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the value of a session property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT session-prop  EMPTY>
<!-- The name of the property -->
<!ATTLIST session-prop prop   CDATA   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the value of a database property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT database-prop  EMPTY>
<!-- The name of the property -->
<!ATTLIST database-prop prop   CDATA   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the value of a schema property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT schema-prop  EMPTY>
<!-- The name of the property -->
<!ATTLIST schema-prop prop   CDATA   #IMPLIED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the value of a cursor property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT cursor-prop  EMPTY>
<!-- The name of the cursor -->
<!ATTLIST cursor-prop cursor   NMTOKEN   #REQUIRED>
<!-- The name of the property -->
<!ATTLIST cursor-prop prop   (has-curr|has-next|has-prev|is-open|is-closed|at-start|at-first|at-last|at-end|curr|first|last)   "has-next">
<!--===========================================
The micellaneous executables

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An assignment. Used to give variables a value, or to bind parameters to values or variables.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT assn %value-expression;>
<!-- Identifies the variable or parameter. -->
<!ATTLIST assn var   NMTOKEN   #REQUIRED>
<!--===========================================
The catchers

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executes executables that handle an error that occurred during execution.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT catch %executables;>
<!-- A list of names that identify the errors caught by this catcher. -->
<!ATTLIST catch err   NMTOKENS   #REQUIRED>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Executes executables that handle an error not handled by any preceding catch-es.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--===========================================
Value-expression

============================================-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A list of values.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A literal value.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT lit  (#PCDATA)>
<!ATTLIST lit %datatype;>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
References a variable by value
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!ELEMENT val  EMPTY>
<!-- The name that identifies the variable. -->
<!ATTLIST val var   NMTOKEN   #REQUIRED>