Need Help Contributing / Proposing New Project
| Newsgroups | gmane.text.xml.general |
|---|---|
| Message-ID | <20040512075749.18174.h004.c001.wm@mail.liveprecision.com.criticalpath.net> |
To Whom It May Concern: My name is Gene Wenning. I am the President/CEO of an IT consultancy named Live Precision, Inc. For the past three years my company has had a contract with the Boeing company to establish and EAI infrastructure. As part of that work, we found the need to develop an XML based grammar to interact with databases. We named it XSQL. We have just recently learned that it has similar language constructs to the SQL package supplied in JSP SQL JTL. It also has some similarity with XSLT. What we found very powerful was expressing database interaction in an XML based grammar post an XSLT process, have that grammar perform the necessary JDBC interactions, then create an output document of what transpired. I have attached to this e-mail a very minimal language reference. I will need to refine the example sections so that folks get a better idea of its full capabilities. However, I wanted to know if anyone might be interested in sponsoring this as an Apache incubator project. My company would be willing to support such an endeavor. I have been a long time user of Apache's efforts and want to in some way return the favor. Sincerely, Gene Wenning --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
xsql_lrm.html
(text/html, 41.9 KB)
<html>
<head>
<title>LRM</title>
<STYLE TYPE='text/css'>
<!--
H1 { color: green; font-size: 16pt; font-family: arial }
H2 { color: green; font-size: 16pt; font-family: arial }
H3 { color: green; font-size: 12pt; font-family: arial }
BODY {font-size: 12pt; font-family: "times new roman" }
PRE {font-size: 10pt; font-family: "courier new" }
CODE {font-size: 10pt; font-family: "courier new" }
-->
</STYLE>
</head>
<body>
<h2><a name='xsql'>1 xsql</a></h2>
The XSQL language provides a simple way to query or update databases
and produce XML documents from the results of database operations.
<p>
This document specifies the structure and meaning of XSQL programs.
XSQL is an XML-based language.
The structure of an XSQL program is described by its DTD, along with
narrative rules, which express further syntax constraints that
can not be fully expressed through the DTD. Each language construct consists
of one or more elements defined by the DTD.
Moreover, some of the values of attributes an elements must conform
to a well-formed syntax. In these cases, the standard Extended
Backus-Naur Form (EBNF) notation is used to describe the syntax.
<p>
The meaning of an XSQL program is described by narrative rules that describe
the meaning and composition rules for each language construct.
<p>
An XSQL program is given as a set of statements nested in a root
element, whose tag is <i>xsql</i>.
<pre>
<!<i>ELEMENT</i> xsql
((%<a href='#xsql-statement'>xsql-statement</a>;)*)>
<!<i>ATTLIST</i> xsql
root-tag CDATA #IMPLIED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>root-tag</td>
<td valign='top'>
Defines the tag used for the root element of the document produced
by an XSQL program. If this attribute is not specified, then
the tag <i>root</i> will be used.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The contained element <code><a href='#xsql-statement'>xsql-statement*</a></code> defines a list of XSQL statements to be executed.
The statements are executed in the order specified.
<p>
<p>
<i>Example of an XSQL specification:</i><p>
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsql SYSTEM "http://xsql.dtd">
<xsql>
<select name="parts-list" record-tag-name="part">
<sql>
select PART as PARTNO, LLC, PLANNER
from WDS61.IM_TABLE
where part = '114S2608-44'
</sql>
</select>
</xsql>
</pre>
<p>
<i>The XML document produced by the XSQL specification above:</i><p>
<pre>
<root>
<parts-list>
<part>
<PARTNO>114S2608-44</PARTNO>
<LLC>3</LLC>
<PLANNER>P5</PLANNER>
</part>
</parts-list>
</root>
</pre>
<h2><a name='xsql-statement'>2 xsql-statement</a></h2>
A statement defines an action to be performed when it is exeucted.
<p>
XSQL supports several kinds of statements. Each type of statement is
explained in later sections.
<pre>
<!<i>ENTITY</i> % xsql-statement
"( <a href='#if'>if</a>
| <a href='#write'>write</a>
| <a href='#log'>log</a>
| <a href='#xml'>xml</a>
| <a href='#query-statement'>query-statement</a>
| <a href='#select'>select</a>
| <a href='#insert'>insert</a>
| <a href='#update'>update</a>
| <a href='#delete'>delete</a>
| <a href='#define-proc'>define-proc</a>
| <a href='#call-proc'>call-proc</a>
| <a href='#te-process'>te-process</a>
| <a href='#call-te'>call-te</a>
| <a href='#import-class'>import-class</a>)">
</pre>
<p>
Many statements can include XSQL expressions in either
attributes or subelements.
Expressions appear in attributes and elements in one of the following
two ways
<ol>
<li>The value of the attribute or element is a complete XSQL expression.
<p>
For example, in an if-statement, the attribute <code>condition</code> contains
a complete XSQL expression.
Consider the following if-statment:
<pre>
<if condition="count != 0">
.
.
.
</if>
</pre>
When it is executed the expression is
evaluated, and the value
of the expression is used to determine how the remainder of
the if-statement is executed.
<p>
</li>
<li>The value of the attribute or element contains embedded expressions.
In this case, the expressions appear between the delimeters
<code>{%</code> and <code>%}</code>.
The final value of the attribute or element is defined as
the original text value with each expression replaced by its value.
<p>
For example, when the following write statement is executed:
<pre>
<write value="Let's sit in row {%12 + 5%}."/>
</pre>
the string
<pre>
Let's sit in row 17.
</pre>
is written.
</ol>
<p>
The next section describes expressions in more detail.
<h2>2.1 Expressions</h2>
An expression defines a computation to be performed by applying
operators to operands.
The operands can be either constant values, variables, or other expressions.
<p>
An expression consists of a sequence of white space and lexical elements.
White space is either the space character, the horizontal tab character, the
carriage return character, or the new line character.
<p>
A lexical element is a well-formed sequence of characters and
is either an identifier, a constant, or a special symbol.
There may be
The meaning of an expression is not affected by white space,
and depends only on the sequence of lexical elements.
<h3>Special Symbols</h3>
Special symbols are made up or one or two characters. They are used in expressions to denote operators or to parenthesize parts of expressions.
<p>
The one character speical symbols are:
<pre>
( ) [ ] + - * / % . , < > ! =
</pre>
<p>
The two character special symbols are:
<pre>
<= >= == && ||
</pre>
<p>
Lexical elements cannot contain white space, with the exception of string
literals, which may contain the space character.
<h3>Identifiers</h3>
Identifiers are used as names.
<p>
<pre>
identifier ::= letter {[underline] letter_or_digit}
letter_or_digit ::= letter | digit
letter ::=
<b>a</b> | <b>b</b> | <b>c</b> | <b>d</b> | <b>e</b> | <b>f</b> | <b>g</b> | <b>h</b> | <b>i</b> | <b>j</b> | <b>k</b> | <b>l</b> |
<b>m</b> | <b>n</b> | <b>o</b> | <b>p</b> | <b>q</b> | <b>r</b> | <b>s</b> | <b>t</b> | <b>u</b> | <b>v</b> | <b>w</b> | <b>x</b> |
<b>y</b> | <b>z</b> | <b>A</b> | <b>B</b> | <b>C</b> | <b>D</b> | <b>E</b> | <b>F</b> | <b>G</b> | <b>H</b> | <b>I</b> | <b>J</b> |
<b>K</b> | <b>L</b> | <b>M</b> | <b>N</b> | <b>O</b> | <b>P</b> | <b>Q</b> | <b>R</b> | <b>S</b> | <b>T</b> | <b>U</b> | <b>V</b> |
<b>W</b> | <b>X</b> | <b>Y</b> | <b>Z</b>
digit ::= <b>0</b> | <b>1</b> | <b>2</b> | <b>3</b> | <b>4</b> | <b>5</b> | <b>6</b> | <b>7</b> | <b>8</b> | <b>9</b>
underline ::= <b>_</b>
</pre>
An identifier can be the name of variable, constant, field (of a structured
type), or method.
<p>
All characters of an identifier are signficant, and upper and lower case
letters are <u>not</u> considered the same.
<p>
<i>Examples of identifiers:</i><p>
<pre>
a index lastName
String T3 The_Last_Record
</pre>
<h3>Numeric Literals</h3>
Numeric literals represent constant number values.
There are two types of numeric literals, real numbers and integers.
Real numbers have a decimal point and integers do not.
<p>
<pre>
numeric_literal ::= digits [<b>.</b>digits]
digits ::= digit {digit}
</pre>
<p>
<i>Examples of integers:</i><p>
<pre>
23 100 51
</pre>
<p>
<i>Examples of reals:</i><p>
<pre>
23.0 100.2332 0.51
</pre>
<h3>String Literals</h3>
String literals represent string values. A string is a sequence
of zero or more characters.
<p>
<pre>
string_literal ::= "{character}" | '{character}'
</pre>
<p>
<i>Examples of strings:</i><p>
<pre>
"" // the empty string
'' // the empty string
"A"
"He can't go" // A string that contains a '
'121'
'"Help"' // A string that contains a "
</pre>
<h3>Expression Syntax</h3>
The syntax for an expression is given by the following rules:
<pre>
expression ::=
relation {<b>&&</b> relation} | relation {<b>||</b> relation}
relation ::=
simple_expression [relational_operator simple_expression]
relational_operator ::=
<b><</b> | <b><=</b> | <b>></b> | <b>>=</b> | <b>!=</b> | <b>==</b>
simple_expression ::=
[adding_operator] term {adding_operator term}
adding_operator ::= <b>+</b> | <b>-</b>
term ::= factor {multiplying_operator factor}
multiplying_operator ::= <b>*</b> | <b>/</b> | <b>%</b>
factor ::= primary | <b>!</b> primary
primary ::=
numeric_literal
| string_literal
| identifier
| <b>(</b>expression<b>)</b>
| primary <b>[</b>expression<b>]</b>
| primary <b>.</b> identifier
| primary <b>(</b> [expression {<b>,</b> expression}] <b>)</b>
</pre>
<h3>Expression Evaluation</h3>
Expressions are evaluated from left to right using the following
precedence rules: first <i>primaries</i> are evaluated,
then <i>factors</i> are evaluated,
then <i>terms</i> are evaluated,
then <i>simple expressions</i> are evaluated,
then <i>relations</i> are evaluated,
and finally the complete <i>expression</i> is evaluated.
<h3>Types and Operations</h3>
A type defines a set of values that may be assumed by an expression
and the operations that may be performed on the expression.
<h3>Boolean Type</h3>
The values of the type boolean are <code>false</code> and <code>true</code>.
The following logical operators are defined for booleans.
<pre>
! not
&& and
|| or
</pre>
The </code>!</code> operator takes a boolean and return an boolean.
The <code>&&</code> and <code>||</code> operators take two boolean
and return an boolean.
<h3>Integer Type</h3>
The values of the type integer are the finite, successive, whole numbers.
The following arithmetic operators are defined for integers.
<pre>
+ unary plus
- unary minus
+ addition
- subtraction
* multiplication
/ integer division
% modulus
</pre>
The unary plus and minus operators take an integer and return an integer.
The other operators take two integers and return an integer.
<p>
The following relational operators are defined for integers. These operators
take two integers and return a boolean.
<pre>
< less than
<= less than equal
> greater than
>= greater than equal
== equal
!= not equal
</pre>
If one of the operands
of the binary arithmetic or relational operators,
except the <code>+</code> operator,
is an integer and the other is a string,
then the string is converted to an integer and the operation is
performed on the two integers.
If the string does not represent a valid integer constant,
then an error occurs.
<p>
Note that the <code>+</code> operator was excluded from the implicit
conversion rule above,
because, if either operand of the <code>+</code> operator
is a string, then the other operand is converted to a string and
the string concatenation operation is performed.
<h3>Real Type</h3>
The values of the type real are a finite subset of the real numbers.
The following arithmetic operators are defined for reals.
<pre>
+ unary plus
- unary minus
+ addition
- subtraction
* multiplication
/ division
% modulus
</pre>
The unary plus and minus operators take a real and return a real.
The other operators take two reals and return a real.
<p>
The following relational operators are defined for reals. These operators
take two reals and return a boolean.
<pre>
< less than
<= less than equal
> greater than
>= greater than equal
== equal
!= not equal
</pre>
If one of the operands
of a binary arithmetic or relational operator
is a real and the other is an integer,
then the integer is converted to a real, and the operation is
performed on the two reals.
<p>
If one of the operands
of a binary arithmetic or relational operator,
except the <code>+</code> operator,
is a real and the other is a string,
then the string is converted to a real and the operation is
performed on the two reals.
If the string does not represent a valid real constant, then an error occurs.
<h3>String Type</h3>
The values of the type <i>string</i> are sequences of zero or more characters.
<p>
The following relational operators are defined for strings. These operators
take two strings and return a boolean.
<pre>
< less than
<= less than equal
> greater than
>= greater than equal
== equal
!= not equal
</pre>
<p>
The operation string concatenation is also defined for strings.
It takes two strings and returns a string.
<pre>
+ string concatenation
</pre>
<p>
If either operand
of the binary <code>+</code> operator is a string,
then the other operand is converted to a string and
the concatenation operation is performed on the two strings.
<h3>List Type</h3>
A list is a sequence of zero or more values of any type.
Each value in the list has a fixed ordinal position. The position
of the first value is zero. The length of the list is the number of
values in the list.
<p>
The operators defined for lists are
<pre>
[<i>expression</i>] subscript
.length get length
</pre>
<p>
The subscript opertion returns a value at a given position in the list.
The position is given by an integer valued expression between the
two brackets.
The position must be in the range <code>0..<i>list</i>.length-1</code> or an
error occurs.
<p>
The <code>.length</code> returns an integer, which is the length of the list.
<h3>Record Type</h3>
A record is composite type consisting of zero or more fields. Each
field has name and contains a value. The values may be of different types.
<p>
The operators defined for records are
<pre>
.<i>field-name</i> field selection
</pre>
<p>
The field selection opertion returns the value of the named field.
If the record does not contain a field with specified name,
then an error occurs.
<p>
<h3>Class Type</h3>
Every XSQL type is associated with a Java class type.
The following table shows the the association.
<p>
<table>
<tr><th>XSQL Type</th><th>Java Class Type</th></tr>
<tr><td>boolean</td><td>Boolean</td></tr>
<tr><td>integer</td><td>Integer or Long</td></tr>
<tr><td>real</td><td>Double</td></tr>
<tr><td>string</td><td>String</td></tr>
<tr><td>list</td><td>Any Java class type that implements the XSQL array interface</td></tr>
<tr><td>record</td><td>Any Java class type that implements the XSQL record interface</td></tr>
</table>
<p>
In addition, the user may set XSQL variables to objects that belong to
any Java class type.
XSQL provides operators to access fields and methods of these objects.
<p>
The operators defined for all values are
<pre>
.<i>field-name</i> field selection
.<i>method-name(parameter-list)</i> method call
</pre>
<h2><a name='if'>3 if</a></h2>
An <i>if statement</i> selects one of it's enclosed statement lists for
execution.
<pre>
<!<i>ELEMENT</i> if
(<a href='#then'>then</a>,
<a href='#else'>else</a>?)>
<!<i>ATTLIST</i> if
condition CDATA #REQUIRED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>condition</td>
<td valign='top'>
A boolean valued XSQL expression.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
</table>
<pre>
<!<i>ELEMENT</i> then
((%<a href='#xsql-statement'>xsql-statement</a>;)*)>
</pre>
<pre>
<!<i>ELEMENT</i> else
((%<a href='#xsql-statement'>xsql-statement</a>;)*)>
</pre>
<p>
The contained element <code><a href='#xsql-statement'>xsql-statement*</a></code> defines a list of XSQL statements to be executed.
<p>
When an if statement is executed, the condition is evaluated. If the
condition evaluates to true,
the statement list in the <i>then</i> element is executed.
If the condition evalutes to false and an <i>else</i> element is included,
then the statement list in the <i>else</i> element is executed.
Otherwise, no included statement lists are executed.
<p>
<i>Example of a basic if statement:</i><p>
<pre>
<if condition="6*2==12">
<then><write value="then part executed"/></then>
<else><write value="else part executed"/></else>
</if>
</pre>
<p>
<i>Example of an if statement that conditionally executes a call-te statement
based on the results of a query:</i><p>
<pre>
<select name="partExistance">
<sql>
select count(*) as count
from WDS61.IM_TABLE
where PART = '$CP5'
</sql>
</select>
<if condition="partExistance.COUNT==1">
<then>
<call-te procedure-name="EXEC_ALL"
package-name="ENGINEERING_ADDPART" schema-name="WDS61">
<arg name="PART" value="$CP5"/>
<arg name="VDESC" value="CP3"/>
<arg value="EA" name="UM"/>
<arg name="PUR_MFG" value="M"/>
<arg value="L" name="PART_TYPE"/>
<arg name="DFLT_STKRM" value="54"/>
</call-te>
</then>
</if>
</pre>
<h2><a name='write'>4 write</a></h2>
A <i>write statement</i> writes a value to standard out.
It is provided to help debug XSQL programs.
<pre>
<!<i>ELEMENT</i> write
(value?)>
<!<i>ATTLIST</i> write
value CDATA #IMPLIED>
<!<i>ELEMENT</i> value
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>value</td>
<td valign='top'>
The value to be written, given as an attribute.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The optional contained element <code>value?</code> specifies the value to be written, given as a element.
<h2><a name='log'>5 log</a></h2>
A <i>log statement</i> writes a value to the XSQL log.
<pre>
<!<i>ELEMENT</i> log
(value?)>
<!<i>ATTLIST</i> log
level (debug|info|error|warning) #IMPLIED
value CDATA #IMPLIED>
<!<i>ELEMENT</i> value
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>level</td>
<td valign='top'>
The level of severity to be associated with the log message.
<p>The legal values for this attribute are <code>(debug|info|error|warning)</code>.</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>value</td>
<td valign='top'>
The value to be written, given as an attribute.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The optional contained element <code>value?</code> specifies the value to be written, given as a element.
<h2><a name='xml'>6 xml</a></h2>
An <i>XML statement</i> adds an element to the current XML document.
<pre>
<!<i>ELEMENT</i> xml
(value?,
(%<a href='#xsql-statement'>xsql-statement</a>;)*)>
<!<i>ATTLIST</i> xml
tag CDATA #REQUIRED
value CDATA #IMPLIED>
<!<i>ELEMENT</i> value
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>tag</td>
<td valign='top'>
The tag for the element to be added.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>value</td>
<td valign='top'>
The text contents of the element.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The optional contained element <code>value?</code> specifies the text contents of the element specified by an element instead
of an attribute.
<p>
The contained element <code><a href='#xsql-statement'>xsql-statement*</a></code> defines a list of XSQL statements to be executed.
These statements will
add any XML they produce to the element created by this statement.
<h2><a name='query-statement'>7 query-statement</a></h2>
Query statements are used to select, insert, update, or delete data
from a database.
<pre>
<!<i>ENTITY</i> % query-statement
"( <a href='#select'>select</a>
| <a href='#insert'>insert</a>
| <a href='#update'>update</a>
| <a href='#delete'>delete</a>)">
<!<i>ELEMENT</i> sql
(#PCDATA)>
</pre>
<h2><a name='select'>8 select</a></h2>
The <i>select statement</i> is used to read data from a database
and store the result in an XML document.
<pre>
<!<i>ELEMENT</i> select
(sql,
(%<a href='#xsql-statement'>xsql-statement</a>;)*)>
<!<i>ATTLIST</i> select
name CDATA #REQUIRED
record-tag CDATA #IMPLIED>
<!<i>ELEMENT</i> sql
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The name of query statement.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>record-tag</td>
<td valign='top'>
The value to be used for the surrounding XML document tag for each
record returned from the record set.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The contained element <code>sql</code> specifies the SQL for the query statement. The query string may contain
embedded XSQL expressions.
<p>
The contained element <code><a href='#xsql-statement'>xsql-statement*</a></code> defines a list of XSQL statements to be executed.
These statements will be executed for each row returned
by the select statement. Before these statements are executed
the current XML document will be set to the element produced
for the associated row. Thus, these statements will add any
XML document they produce to the document for the row.
<p>
The select statement executes the specified SQL statement and stores
the results in the current XML document.
<p>
The root element of the XML document produced by the select statement
has the tag given by the attribute <code>name</code>.
It contains an element for each row returned by the select statement.
The tag for each row element is given by the attribute <code>record-tag</code>.
Each row element contains an element for each column in the returned
row. The tag for each column element is the name of column. Each column
element contains parsed character data, which is its value.
<p>
Moreover, a select statement
declares a new variable and sets the variable's value
to the results of the query.
The name of the variable is the name given by the <code>name</code>
attribute.
The value is a list of records, one record for each row returned.
Each record contains a field for each in the returned row.
The name of the field is the name of the column, and the value of the
field is the value of the column.
<p>
<i>Example of a select statement:</i><p>
<pre>
<select name="parts-list" record-tag="part">
<sql>
select PART as PARTNO, LLC, PLANNER
from WDS61.IM_TABLE
where part = '114S2608-44'
</sql>
</select>
</pre>
<i>The XML document produced by the select statement above:</i><p>
<pre>
<root>
<parts-list>
<part>
<PARTNO>114S2608-44</PARTNO>
<LLC>3</LLC>
<PLANNER>P5</PLANNER>
</part>
</parts-list>
</root>
</pre>
<h2><a name='insert'>9 insert</a></h2>
<pre>
<!<i>ELEMENT</i> insert
(sql)>
<!<i>ATTLIST</i> insert
name CDATA #REQUIRED>
<!<i>ELEMENT</i> sql
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The name of query statement.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
</table>
<p>
The contained element <code>sql</code> specifies the SQL for the query statement. The query string may contain
embedded XSQL expressions.
<h2><a name='update'>10 update</a></h2>
<pre>
<!<i>ELEMENT</i> update
(sql)>
<!<i>ATTLIST</i> update
name CDATA #REQUIRED>
<!<i>ELEMENT</i> sql
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The name of query statement.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
</table>
<p>
The contained element <code>sql</code> specifies the SQL for the query statement. The query string may contain
embedded XSQL expressions.
<h2><a name='delete'>11 delete</a></h2>
<pre>
<!<i>ELEMENT</i> delete
(sql)>
<!<i>ATTLIST</i> delete
name CDATA #REQUIRED>
<!<i>ELEMENT</i> sql
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The name of query statement.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
</table>
<p>
The contained element <code>sql</code> specifies the SQL for the query statement. The query string may contain
embedded XSQL expressions.
<h2><a name='define-proc'>12 define-proc</a></h2>
A <i>define procedure statement</i> associates a name with
a database stored procedure definition.
The name can then be used to invoke the database stored procedure from
XSQL, using the <i>call procedure</i> statement.
<pre>
<!<i>ELEMENT</i> define-proc
(<a href='#stored-proc'>stored-proc</a>)>
<!<i>ATTLIST</i> define-proc
name CDATA #REQUIRED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The name of the stored procedure being defined.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
</table>
<p>
The contained element <code><a href='#stored-proc'>stored-proc</a></code> specifies the stored procedure definition.
<pre>
<!<i>ELEMENT</i> stored-proc
(return-parameter,
<a href='#parameter'>parameter</a>*)>
<!<i>ATTLIST</i> stored-proc
schema-name CDATA #IMPLIED
package-name CDATA #IMPLIED
procedure-name CDATA #REQUIRED
record-tag CDATA #IMPLIED
record-set-tag CDATA #IMPLIED>
<!<i>ELEMENT</i> return-parameter
(<a href='#parameter'>parameter</a>?)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>schema-name</td>
<td valign='top'>
The name of the database schema that contains the stored procedure.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>package-name</td>
<td valign='top'>
The name of the package that contains the stored procedure.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>procedure-name</td>
<td valign='top'>
The name of the stored procedure as given in the data base.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>record-tag</td>
<td valign='top'>
The value to be used for the surrounding XML document tag for each
record returned from the record set (if applicable).
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>record-set-tag</td>
<td valign='top'>
The tag to be used to wrap the returned record set (if applicable).
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The contained element <code><a href='#parameter'>return-parameter?</a></code> specifies the return type of the stored procedure, if the procedure is a function.
<p>
The contained element <code><a href='#parameter'>parameter*</a></code> specifies the parameters for the stored procedure.
<pre>
<!<i>ELEMENT</i> parameter
<b>EMPTY</b>>
<!<i>ATTLIST</i> parameter
pos CDATA #REQUIRED
name CDATA #REQUIRED
mode (in|out|inout) "inout"
jdbc-type (BIGINT|BIT|BOOLEAN|CHAR|CURSOR|DATE|DECIMAL|DOUBLE|FLOAT|INTEGER|LONGVARCHAR|NUMERIC|REAL|SMALLINT|TIME|TIMESTAMP|TINYINT|VARCHAR) #REQUIRED
length CDATA #IMPLIED
scale CDATA #IMPLIED
simple-date-format CDATA #IMPLIED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>pos</td>
<td valign='top'>
The position of the parameter.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The name of the parameter.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>mode</td>
<td valign='top'>
The mode of the parameter.
<p>The legal values for this attribute are <code>(in|out|inout)</code>.<p>The default value for this attribute is <code>inout</code>.</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>jdbc-type</td>
<td valign='top'>
The JDBC type of the parameter.
<p>The legal values for this attribute are <code>(BIGINT|BIT|BOOLEAN|CHAR|CURSOR|DATE|DECIMAL|DOUBLE|FLOAT|INTEGER|LONGVARCHAR|NUMERIC|REAL|SMALLINT|TIME|TIMESTAMP|TINYINT|VARCHAR)</code>.</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>length</td>
<td valign='top'>
The length of the parameter.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>scale</td>
<td valign='top'>
The scale attribute associated with the parameter.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>simple-date-format</td>
<td valign='top'>
The Java simple date format (see java.text.SimpleDateFormat) expression
that describes the input format used for specifying dates and times, and
also, the format which will be used for displaying them within the
generated XML document.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<h2><a name='call-proc'>13 call-proc</a></h2>
<pre>
<!<i>ELEMENT</i> call-proc
(<a href='#arg'>arg</a>*,
(%<a href='#xsql-statement'>xsql-statement</a>;)*)>
<!<i>ATTLIST</i> call-proc
name CDATA #REQUIRED
define-proc-name CDATA #IMPLIED
schema-name CDATA #IMPLIED
package-name CDATA #IMPLIED
procedure-name CDATA #IMPLIED
record-tag CDATA #IMPLIED
record-set-tag CDATA #IMPLIED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The logical name of the statement.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>define-proc-name</td>
<td valign='top'>
The name of the define-proc statement that defines the database procedure
to be called. If not supplied, the logical name of the statement
will be used.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>schema-name</td>
<td valign='top'>
The name of the database schema that contains the stored procedure.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>package-name</td>
<td valign='top'>
The name of the package that contains the stored procedure.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>procedure-name</td>
<td valign='top'>
The name of the stored procedure as given in the data base.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>record-tag</td>
<td valign='top'>
The value to be used for the surrounding XML document tag for each
record returned from the record set (if applicable).
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>record-set-tag</td>
<td valign='top'>
The tag to be used to wrap the returned record set (if applicable).
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The contained element <code><a href='#arg'>arg*</a></code> specifies the arguments to call the stored procedure with.
<p>
The contained element <code><a href='#xsql-statement'>xsql-statement*</a></code> defines a list of XSQL statements to be executed.
These statements will for each row returned by the stored procedure
call.
<pre>
<!<i>ELEMENT</i> arg
(value?)>
<!<i>ATTLIST</i> arg
name CDATA #IMPLIED
pos CDATA #IMPLIED
simple-date-format CDATA #IMPLIED
value CDATA #IMPLIED>
<!<i>ELEMENT</i> value
(#PCDATA)>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
The name of the parameter this argument is associated with.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>pos</td>
<td valign='top'>
The position of the parameter this argument is associated with.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>simple-date-format</td>
<td valign='top'>
The Java simple date format (see java.text.SimpleDateFormat) expression
that describes the input format used for specifying dates and times, and
also, the format which will be used for displaying them within the
generated XML document.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>value</td>
<td valign='top'>
The value to be used for the parameter when the call is made.
The value of an argument can contain embedded expressions.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The optional contained element <code>value?</code> specifies the value, specified as an element instead of an attribute,
to be used for the parameter when the call is made.
<h2><a name='te-process'>14 te-process</a></h2>
A TE process is used to represent the beginning and end of a
sequence of TE calls.
The TE process maintains the status of the TE calls inside the
TE process by checking return codes.
The TE process also handles the decision of whether or not
to commit or rollback all TE's called inside the TE process.
For example, while executing a statement list,
if one or more te calls are made and complete without error the
TE process will issue a syncCommit call.
However, if one or more TE calls are made and an error occurs,
the TE process will issue a syncRollback.
<p>
The only required attribute on the TE process is
<i>name</i>, which is currently unused,
but is to be incorporated into a future version of XSQL
<pre>
<!<i>ELEMENT</i> te-process
((%<a href='#xsql-statement'>xsql-statement</a>;)*)>
<!<i>ATTLIST</i> te-process
name CDATA #IMPLIED
schema CDATA #IMPLIED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>
Defines the name of the TE process.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>schema</td>
<td valign='top'>
Defines the schema the TE process runs in. If the schema is not
specified, the TE process will run in the schema whose name
is established by the XSQL runtime environment.
</td>
<td align='center' valign='top'>No</td>
</tr>
</table>
<p>
The contained element <code><a href='#xsql-statement'>xsql-statement*</a></code> defines a list of XSQL statements to be executed as part
of a TE process.
<h2><a name='call-te'>15 call-te</a></h2>
A <i>call TE statement</i> invokes the execution of a TE. The call
specifies the association of arguments with the formal parameters
of the TE.
<pre>
<!<i>ELEMENT</i> call-te
(<a href='#arg'>arg</a>*)>
<!<i>ATTLIST</i> call-te
schema-name CDATA #IMPLIED
package-name CDATA #REQUIRED
procedure-name CDATA #REQUIRED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>schema-name</td>
<td valign='top'>
The name of the database schema that contains the TE.
</td>
<td align='center' valign='top'>No</td>
</tr>
<tr>
<td valign='top'>package-name</td>
<td valign='top'>
The name of the package that contains the TE's.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>procedure-name</td>
<td valign='top'>
The name of the TE procedure to call.
</td>
<td align='center' valign='top'>Yes</td>
</tr>
</table>
<p>
The contained element <code><a href='#arg'>arg*</a></code> specifies the arguments to call the TE with.
<p>
<i>Example of a call TE statement:</i><p>
<pre>
<call-te procedure-name="EXEC_ALL"
package-name="ENGINEERING_ADDPART" schema-name="WDS61">
<arg name="PART" value="$CP5"/>
<arg name="VDESC" value="CP3"/>
<arg value="EA" name="UM"/>
<arg name="PUR_MFG" value="M"/>
<arg value="L" name="PART_TYPE"/>
<arg name="DFLT_STKRM" value="54"/>
</call-te>
</pre>
<h2><a name='import-class'>16 import-class</a></h2>
<pre>
<!<i>ELEMENT</i> import-class
<b>EMPTY</b>>
<!<i>ATTLIST</i> import-class
name CDATA #REQUIRED
java-name CDATA #REQUIRED>
</pre>
<h3>Attribute Definitions</h3>
<table border='1' width='550' cellpadding='2' cellspacing='0'>
<tr>
<td valign='top' width='150'><b>Attribute</b></td>
<td valign='top' width='350'><b>Description</b></td>
<td align='center' width='50' valign='top'><b>Required</b></td>
</tr>
<tr>
<td valign='top'>name</td>
<td valign='top'>This attribute is not currently supported.</td>
<td align='center' valign='top'>Yes</td>
</tr>
<tr>
<td valign='top'>java-name</td>
<td valign='top'>This attribute is not currently supported.</td>
<td align='center' valign='top'>Yes</td>
</tr>
</table>
</body>
</html>