SQL*Module for Ada Programmer's Guide Release 8.0 Part Number A58231-01 |
|
This appendix describes the syntax of Module Language, using syntax diagrams.
For the complete syntax of all SQL statements, including syntax diagrams, see PL/SQL User's Guide and Reference.
Syntax diagrams use lines and arrows to show how procedure names, parameters, and other language elements are sequenced to form statements. Follow each diagram in the direction shown by the lines and arrows.
In these syntax diagrams, Module Language keywords appear in uppercase; parameters or other variable items appear in lowercase. Delimiters and terminators (such as '(', ',', and so on) appear in their literal form inside circles.
If the syntax diagram contains more than one possible path, you must select the path appropriate to your application.
If you have the choice of more than one keyword or parameter, your options appear in a vertical list. If any of the parameters in a vertical list appears on the main path, then one of them is required. That is, you must choose one of the parameters, but not necessarily the one that appears on the main path.
Single required parameters appear on the main path, that is, on the horizontal line you are currently traveling. If parameters appear in a vertical list below the main path, they are optional, that is, you need not choose one of them. In the AUTHORIZATION clause of the module preamble, the username is mandatory, but the password and database to connect to are optional, as shown in this diagram:
Text description of illustration appba.gif.
Loops let you repeat the syntax contained within them as many times as you like.
Here is the syntax diagram for a module:
Text description of illustration appba3.gif.
Thus, a module consists of a preamble, followed by zero or more cursor declarations, followed by one or more procedures.
The syntax of the preamble is:
Text description of illustration appba4.gif.
The following diagram shows the syntax of the optional language clause (lang_clause) of the preamble:
Text description of illustration appba5.gif.
The following diagram shows the syntax of the AUTHORIZATION clause:
Text description of illustration appba6.gif.
The syntax of the cursor declaration is:
Text description of illustration appba7.gif.
The SQL92 syntax for a procedure definition is:
Text description of illustration appba8.gif.
where the parameter list is defined as:
Text description of illustration appba9.gif.
Where type_dcl is defined as:
Text description of illustration appba11.gif.
Length L has values: 1< L<32500. n is the size of the array.
You can place the SQLSTATE and/or the SQLCODE status parameters anywhere in the parameter list; they are conventionally shown at the end of the parameter list in this Guide, as indicated in this syntax diagram. You must include either SQLSTATE (recommended) or SQLCODE (for backward compatibility with SQL89). You can include both, in any order. Do not place a colon before the status parameter, and do not include a datatype after it.
The syntax of a procedure declaration that includes a WITH INTERFACE clause is formally defined as:
Text description of illustration appba10.gif.
The int_param_formal_name is defined as:
Text description of illustration appba1.gif.
The SQL datatype in the WITH INTERFACE clause must be compatible with the corresponding PL/SQL datatype in the procedure declaration parameter list.
The syntax of the mode attribute is:
Text description of illustration appba2.gif.
If mode is omitted, the value is IN.