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.
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
IBM System R — реляционная СУБД
Terms: IBM System R — реляционная СУБД