Skip Headers
Oracle® SQL*Module for Ada Programmer's Guide
10g Release 2 (10.2)

Part Number A58231-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

B 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 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:

Description of adaauth.gif follows
Description of the illustration adaauth.gif

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

Here is the syntax diagram for a module:

Description of adamod.gif follows
Description of the illustration adamod.gif

Thus, a module consists of a preamble, followed by zero or more cursor declarations, followed by one or more procedures.

Preamble

The syntax of the preamble is:

Description of adapre.gif follows
Description of the illustration adapre.gif

LANGUAGE Clause

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

Description of adalang.gif follows
Description of the illustration adalang.gif

AUTHORIZATION Clause

The following diagram shows the syntax of the AUTHORIZATION clause:

Description of adaauth.gif follows
Description of the illustration adaauth.gif

Cursors

The syntax of the cursor declaration is:

Description of adacur.gif follows
Description of the illustration adacur.gif

Procedure Definitions

The SQL92 syntax for a procedure definition is:

Description of adaproc.gif follows
Description of the illustration adaproc.gif

where the parameter list is defined as:

Description of adapar.gif follows
Description of the illustration adapar.gif

Where type_dcl is defined as:

Description of adatyp.gif follows
Description of the illustration adatyp.gif

Length L has values: 1< L<32500. n is the size of the array.

You can place the SQLSTATE 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.

WITH INTERFACE CLAUSE

The syntax of a procedure declaration that includes a WITH INTERFACE clause is formally defined as:

Description of adawith.gif follows
Description of the illustration adawith.gif

The int_param_formal_name is defined as:

Description of adaipfn.gif follows
Description of the illustration adaipfn.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:

Description of adamode.gif follows
Description of the illustration adamode.gif

If mode is omitted, the value is IN.