You get a bonus - 1 coin for daily activity. Now you have 1 coin

16.2. Module Language

Lecture



The structure of the SQL module in the SQL / 89 standard is determined by the following syntax rules:

  <module> :: =
    <module name clause>
    <language clause>
    <module autorization clause>
   [<declare cursor> ...]
   <procedure> ...
 <module name clause> :: = MODULE [<module name>]
 <language clause> :: = LANGUAGE {COBOL |  FORTRAN |  PASCAL |  PLI}
 <module autorization clause> :: =
    AUTHORIZATION <module autorization identifier>
 <module autorization identifier> :: = <autorization identifier> 

It is significant that each SQL module is oriented for use in programs written in a specific programming language. If the module contains procedures for working with cursors, then all cursors should be specified at the beginning of the module. Note that declaring a cursor is not immersed in any procedure, because it is a descriptive, not an executable, SQL statement.

16.2.1. Procedure definition

Procedures in the SQL module are defined by the following syntactic structures:

  <procedure> :: =
    PROCEDURE <procedure name>
    <parameter declaration> ...;
    <SQL statment>;
 <parameter declaration> :: =
   <parameter name> <data type>
 |  <SQLCODE parameter>
 <SQLCODE parameter> :: = SQLCODE
 <SQL statement> :: =
   <close statement>
 |  <commit statement>
 |  <delete statement positioned>
 |  <delete statement searched>
 |  <fetch statement>
 |  <insert statement>
 |  <open statement>
 |  <rollback statement>
 |  <select statement>
 |  <update statement positioned>
 |  <update statement searched> 

The names of all procedures in one module should be different. Any parameter name contained in the SQL statement of the procedure must be specified in the parameter declaration section. The number of actual parameters when calling a procedure must match the number of formal parameters specified when it is declared. The list of formal parameters for each procedure must contain exactly one SQLCODE parameter (the response code of the procedure; the possible values ​​of the response codes are standardized, but some of them are defined in the implementation).


Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Databases IBM System R - relational DBMS

Terms: Databases IBM System R - relational DBMS