The Module Body
The module body is either a PSQL module body, or an external module body.PSQL blocks can only have a PSQL module body.
<module-body> ::=
<psql-module-body> | <external-module-body>
<psql-module-body> ::=
AS
[<forward-declarations>]
[<declarations>]
BEGIN
[<PSQL_statements>]
END
<external-module-body> ::=
EXTERNAL [NAME <extname>] ENGINE engine
[AS '<extbody>']
<forward-declarations> ::=
<forward-declare-item> [<forward-declare-item> ...]
<declarations> ::=
<declare-item> [<declare-item> ...]
<forward-declare-item> ::=
<subfunc-forward>
| <subproc-forward>
<declare-item> ::=
<declare-var>
| <declare-cursor>
| <subfunc-def>
| <subproc-def>
<extname> ::=
'<module-name>!<routine-name>[!<misc-info>]'
<declare-var> ::=
!! See DECLARE VARIABLE !!
<declare-cursor> ::=
!! See DECLARE .. CURSOR !!
<subfunc-forward>, <subfunc-def> ::=
!! See DECLARE FUNCTION !!
<subproc-forward>, <subproc-def> ::=
!! See DECLARE PROCEDURE !!
| Parameter | Description |
|---|---|
declarations |
Section for declaring local variables, named cursors, and subroutines |
PSQL_statements |
Procedural SQL statements.Some PSQL statements may not be valid in all types of PSQL.For example, |
subfunc-forward |
Sub-function forward declaration |
subproc-forward |
Sub-procedure forward declaration |
declare_var |
Local variable declaration |
declare_cursor |
Named cursor declaration |
subfunc-def |
Sub-function declaration |
subproc-def |
Sub-procedure declaration |
extname |
String identifying the external procedure |
engine |
String identifying the UDR engine |
extbody |
External procedure body.A string literal that can be used by UDRs for various purposes. |
module-name |
The name of the module that contains the procedure |
routine-name |
The internal name of the procedure inside the external module |
misc-info |
Optional string that is passed to the procedure in the external module |