SQL*Module for Ada Programmer's Guide
Release 8.0






Prev Next

Module Language Syntax

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.

Module Language Syntax Diagrams

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:

Loops let you repeat the syntax contained within them as many times as you like.

Here is the syntax diagram for a module:

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:


The following diagram shows the syntax of the optional language clause (lang_clause) of the preamble:


The following diagram shows the syntax of the AUTHORIZATION clause:


The syntax of the cursor declaration is:

Procedure Definitions

The SQL92 syntax for a procedure definition is:

where the parameter list is defined as:

Where type_dcl is defined as:

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:

The int_param_formal_name is defined as:

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:

If mode is omitted, the value is IN.


Copyright © 1997 Oracle Corporation.

All Rights Reserved.