Using Modules [ ALLBASE/ISQL Reference Manual ] MPE/iX 5.0 Documentation
ALLBASE/ISQL Reference Manual
Using Modules
A module is a set of one or more preprocessed statements that are stored
in the DBEnvironment. Each stored statement is known as a section.
ALLBASE/SQL application programs usually access modules that are stored
by the preprocessor. You can also create modules interactively with the
PREPARE statement in ISQL.
Installing a Module
An installable module, which is created by the ALLBASE/SQL preprocessor
before source code is compiled, contains information that ALLBASE/SQL
uses to execute the application program's SQL statements at run time.
The program can only access the DBEnvironment in which its corresponding
module is stored.
Sometimes you need to transfer a user-written application from one
DBEnvironment to another. For instance, an application may have been
created on a development machine and needs to be transferred to a
production system. You would need to unload the data from one
DBEnvironment and then load it into the new one.
Additionally, to use an application program in a DBEnvironment different
from that in which it was developed, you must move the executable
application program file and the file containing the installable module
to the machine containing the target DBEnvironment.
To store the installable module in the new DBEnvironment, use the ISQL
INSTALL command:
isql=> INSTALL;
File name> SQLMOD.COBOL.HPSQL;
Name of module in this file: PGMR1@COBOL.PROGRAM1
Number of sections installed: 6
COMMIT WORK to save to DBEnvironment.
isql=>
You can use the ISQL LIST INSTALL command to identify the names of the
modules contained in an installable module file. For example:
isql=> LIST INSTALL;
File name> SQLMOD.COBOL.HPSQL;
Name of module in this file: PGMR1@COBOL.PROGRAM1
Name of module in this file: PGMR1@COBOL.PROGRAM2
isql=>
NOTE A module stored in a DBEnvironment by a preprocessor, or a module
installed using the ISQL INSTALL command, should never be executed
directly from ISQL by typing the name of the module. The module
should be executed by running the executable program file.
For more information on using ALLBASE/SQL programmatically, refer to the
ALLBASE/SQL application programming guide for the language you are using.
Modules can be created by the preprocessor or the PREPARE statement. The
preprocessor inserts a single module into the module installation files.
Several module installation files may be joined into a single
installation file with the FCOPY command. The PREPARE statement has an
interactive option which allows creation of a module through ISQL. The
EXECUTE statement can then be used to cause ALLBASE/SQL to execute the
statement that was stored with the PREPARE statement. A module created
by using the PREPARE statement with ISQL cannot be executed by an
application with the preprocessor. For more information on the PREPARE
and EXECUTE statements, refer to the ALLBASE/SQL Reference Manual.
MPE/iX 5.0 Documentation