| United States-English |
|
|
|
![]() |
ALLBASE/SQL COBOL Application Programming Guide: HP 3000 MPE/iX Computer Systems > Chapter 1 Getting Started with ALLBASE/SQL Programming in COBOLThe Stored Section |
|
A section consists of ALLBASE/SQL instructions for executing an SQL command. The SQL commands that do not generate stored sections are listed in the "Stored Sections" paragraph of the "Using the ALLBASE/SQL COBOL Preprocessor." Not every SQL command requires a section. For each SQL command that does require a section, the preprocessor creates the section and assigns to it a unique reference number. In the following preprocessor generated code SQLSECNUM contains the number of the stored section.
A section serves two purposes:
Runtime performance is improved by creating and storing sections at preprocessing time rather than at run time. A section is assigned one of two states at preprocessing time: valid or invalid. A section is valid when access validation criteria are satisfied. If the SQL command references objects that exist at preprocessing time and the individual doing the preprocessing is authorized to issue the command, the stored section is marked as valid. A section is invalid when access validation criteria are not satisfied. If the SQL command references an object that does not exist at preprocessing time or if the individual doing the preprocessing is not authorized to issue the command, the stored section is marked as invalid. After being stored by the preprocessor, a valid section is marked as invalid when such activities as the following occur:
At run time, ALLBASE/SQL executes valid sections and attempts to validate any section marked as invalid. If an invalid section can be validated, as when an altered table does not affect the results of a query, ALLBASE/SQL marks the section as valid and executes it. If an invalid section cannot be validated, as when a table reference is invalid because the table owner name has changed, ALLBASE/SQL returns an error indication to the application program. When a section is validated at run time, it remains in the valid state until an event that invalidates it occurs. The program execution during which validation occurs is slightly slower than program executions following validation. |
||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||